1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-27 19:01:14 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2017-04-06 16:34:52 +00:00
parent 36869efbd1
commit 99fa41011f
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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>'