Merged r2143 and r2144 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.7-stable@2174 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-12-24 11:42:05 +00:00
1 parent de86f4b965
commit 3169291039
3 files changed
+9 -3

No files matched your search

+5 -1
View File
@@ -433,12 +433,15 @@ class RedCloth < String
#
# Flexible HTML escaping
#
def htmlesc( str, mode )
def htmlesc( str, mode=:Quotes )
if str
str.gsub!( '&', '&amp;' )
str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
str.gsub!( "'", '&#039;' ) if mode == :Quotes
str.gsub!( '<', '&lt;')
str.gsub!( '>', '&gt;')
end
str
end
# Search and replace for Textile glyphs (quotes, dashes, other symbols)
@@ -890,6 +893,7 @@ class RedCloth < String
def inline_textile_image( text )
text.gsub!( IMAGE_RE ) do |m|
stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
htmlesc title
atts = pba( atts )
atts = " src=\"#{ url }\"#{ atts }"
atts << " title=\"#{ title }\"" if title