From f5d68651a06abf004552654dfdcd9c41f57ffb05 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 21 Nov 2023 01:03:43 +0000 Subject: [PATCH] Add data-text-formatting attribute for selected markup language to body tag (#20620). Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22472 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/layouts/base.html.erb | 2 +- test/functional/welcome_controller_test.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index bcd6622a7..16a640267 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -17,7 +17,7 @@ <%= yield :header_tags -%> - + <%= call_hook :view_layouts_base_body_top %>
diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 45cbc08ae..d7c6741c9 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -117,6 +117,16 @@ class WelcomeControllerTest < Redmine::ControllerTest assert_select 'body.textarea-proportional' end + def test_data_text_setting_attribute + formats = %w(textile common_mark) + formats.each do |format| + with_settings text_formatting: format do + get :index + assert_select 'body[data-text-formatting=?]', format + end + end + end + def test_logout_link_should_post @request.session[:user_id] = 2