Project

General

Profile

Defect #31021 » 0002-Fullwidth-characters-enclosed-in-lt-and-gt.patch

Yuichi HARADA, 2019-03-28 05:18

View differences:

lib/redmine/wiki_formatting/textile/redcloth3.rb
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?}" }
text.gsub!(%r{<(\/?([!_[[:alnum:]]]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
end
end
(4-4/5)