summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-13 12:45:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-13 12:45:17 +0000
commit97fe797ad36389ea4719e90677408d9eed0cb369 (patch)
tree9ab7596c63230576afeea03b470f1f648d30bba0 /lib
parent8b9fb29d95d8d467da2cc1bdb657503b433305f4 (diff)
downloadredmine-97fe797ad36389ea4719e90677408d9eed0cb369.tar.gz
redmine-97fe797ad36389ea4719e90677408d9eed0cb369.zip
Replace closing html tags with html entity (#910).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1348 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redcloth.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redcloth.rb b/lib/redcloth.rb
index 5ed23b8f7..7e0c71839 100644
--- a/lib/redcloth.rb
+++ b/lib/redcloth.rb
@@ -1134,7 +1134,7 @@ class RedCloth < String
ALLOWED_TAGS = %w(redpre pre code)
def escape_html_tags(text)
- text.gsub!(%r{<((\/?)(\w+))}) {|m| ALLOWED_TAGS.include?($3) ? "<#{$1}" : "&lt;#{$1}" }
+ text.gsub!(%r{<(\/?(\w+)[^>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' if $3}" }
end
end