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:
parent
36869efbd1
commit
99fa41011f
@ -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
|
||||
|
||||
@ -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>'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user