From 99fa41011fb260938005139f1328c46fd3ee64c5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 6 Apr 2017 16:34:52 +0000 Subject: Add kbd to ALLOWED_TAGS (#25503). Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@16500 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/textile/redcloth3.rb | 2 +- test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index 31051fa96..bcb796ec6 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -1202,8 +1202,8 @@ class RedCloth3 < String end end - ALLOWED_TAGS = %w(redpre pre code notextile) + ALLOWED_TAGS = %w(redpre pre code kbd notextile) def escape_html_tags(text) text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } end diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index 03d4ef5e6..548a41de3 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -166,6 +166,12 @@ EXPECTED ) end + def test_kbd + assert_html_output({ + 'test' => 'test' + }, false) + end + def test_use_of_backslashes_followed_by_numbers_in_headers assert_html_output({ 'h1. 2009\02\09' => '

2009\02\09

' -- cgit v1.2.3