summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-06 16:34:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-06 16:34:52 +0000
commit99fa41011fb260938005139f1328c46fd3ee64c5 (patch)
tree5a92afb5b9f24cb521e0f2d943a22545ccb262cc
parent36869efbd199e47278ba5942f5dbb7240bf3f5d5 (diff)
downloadredmine-99fa41011fb260938005139f1328c46fd3ee64c5.tar.gz
redmine-99fa41011fb260938005139f1328c46fd3ee64c5.zip
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
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb2
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb6
2 files changed, 7 insertions, 1 deletions
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}" : "&lt;#{$1}#{'&gt;' 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({
+ '<kbd>test</kbd>' => '<kbd>test</kbd>'
+ }, false)
+ end
+
def test_use_of_backslashes_followed_by_numbers_in_headers
assert_html_output({
'h1. 2009\02\09' => '<h1>2009\02\09</h1>'