diff options
Diffstat (limited to 'lib/redcloth3.rb')
-rw-r--r-- | lib/redcloth3.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index fd56a8752..038522a89 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -408,7 +408,7 @@ class RedCloth3 < String # [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing # [ /"/, '“' ], # double opening # [ /\b( )?\.{3}/, '\1…' ], # ellipsis - [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym + # [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym # [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^<A-Za-z0-9]|$)/, '\1<span class="caps">\2</span>\3', :no_span_caps ], # 3+ uppercase caps # [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash # [ /\s->\s/, ' → ' ], # right arrow @@ -448,9 +448,12 @@ class RedCloth3 < String # Search and replace for Textile glyphs (quotes, dashes, other symbols) def pgl( text ) - GLYPHS.each do |re, resub, tog| - next if tog and method( tog ).call - text.gsub! re, resub + #GLYPHS.each do |re, resub, tog| + # next if tog and method( tog ).call + # text.gsub! re, resub + #end + text.gsub!(/\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/) do |m| + "<acronym title=\"#{htmlesc $2}\">#{$1}</acronym>" end end @@ -467,7 +470,7 @@ class RedCloth3 < String style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN end - style << "#{ $1 };" if not filter_styles and + style << "#{ htmlesc $1 };" if not filter_styles and text.sub!( /\{([^}]*)\}/, '' ) lang = $1 if @@ -810,7 +813,7 @@ class RedCloth3 < String end atts = pba( atts ) atts = " href=\"#{ url }#{ slash }\"#{ atts }" - atts << " title=\"#{ title }\"" if title + atts << " title=\"#{ htmlesc title }\"" if title atts = shelve( atts ) if atts external = (url =~ /^https?:\/\//) ? ' class="external"' : '' |