mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-17 06:28:13 +00:00
Merged r18247 to 3.4-stable (#31520).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@18249 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
92a74472f3
commit
90ee0d2902
@ -1213,7 +1213,13 @@ class RedCloth3 < String
|
|||||||
|
|
||||||
ALLOWED_TAGS = %w(redpre pre code kbd notextile)
|
ALLOWED_TAGS = %w(redpre pre code kbd notextile)
|
||||||
def escape_html_tags(text)
|
def escape_html_tags(text)
|
||||||
text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" }
|
text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) do |m|
|
||||||
|
if ALLOWED_TAGS.include?($2) && $3.present?
|
||||||
|
"<#{$1}#{$3}"
|
||||||
|
else
|
||||||
|
"<#{$1}#{'>' unless $3.blank?}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user