]> source.dussan.org Git - redmine.git/commitdiff
Adds back textile acronyms support (#2077).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 27 Oct 2008 11:50:23 +0000 (11:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 27 Oct 2008 11:50:23 +0000 (11:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1956 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redcloth3.rb
test/unit/helpers/application_helper_test.rb

index 6815ecb7c6f85fd846e878accfdfcdc5ff42e45d..638ef6d97f17d1cb7e243fb3ef93ee6a308c5b2d 100644 (file)
@@ -401,22 +401,22 @@ class RedCloth3 < String
     #   [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1&#8217;' ], # single closing
     #   [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '&#8217;' ], # single closing
     #   [ /\'/, '&#8216;' ], # single opening
-        [ /</, '&lt;' ], # less-than
-        [ />/, '&gt;' ], # greater-than
+    #   [ /</, '&lt;' ], # less-than
+    #   [ />/, '&gt;' ], # greater-than
     #   [ /([^\s\[{(])?"(\s|:|$)/, '\1&#8221;\2' ], # double closing
     #   [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1&#8221;' ], # double closing
     #   [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '&#8221;' ], # double closing
     #   [ /"/, '&#8220;' ], # double opening
-        [ /\b( )?\.{3}/, '\1&#8230;' ], # ellipsis
+    #   [ /\b( )?\.{3}/, '\1&#8230;' ], # ellipsis
         [ /\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&#8212;' ], # em dash
-        [ /\s->\s/, ' &rarr; ' ], # right arrow
-        [ /\s-\s/, ' &#8211; ' ], # en dash
-        [ /(\d+) ?x ?(\d+)/, '\1&#215;\2' ], # dimension sign
-        [ /\b ?[(\[]TM[\])]/i, '&#8482;' ], # trademark
-        [ /\b ?[(\[]R[\])]/i, '&#174;' ], # registered
-        [ /\b ?[(\[]C[\])]/i, '&#169;' ] # copyright
+    #   [ /(^|[^"][>\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&#8212;' ], # em dash
+    #   [ /\s->\s/, ' &rarr; ' ], # right arrow
+    #   [ /\s-\s/, ' &#8211; ' ], # en dash
+    #   [ /(\d+) ?x ?(\d+)/, '\1&#215;\2' ], # dimension sign
+    #   [ /\b ?[(\[]TM[\])]/i, '&#8482;' ], # trademark
+    #   [ /\b ?[(\[]R[\])]/i, '&#174;' ], # registered
+    #   [ /\b ?[(\[]C[\])]/i, '&#169;' ] # copyright
     ]
 
     H_ALGN_VALS = {
@@ -1010,7 +1010,7 @@ class RedCloth3 < String
 
     def glyphs_textile( text, level = 0 )
         if text !~ HASTAG_MATCH
-            #pgl text
+            pgl text
             footnote_ref text
         else
             codepre = 0
index 13fa262f121be22edef5033b5ac8118bcbd3c793..6e1356beededea9f17071712fdbb5b7265519f5e 100644 (file)
@@ -219,6 +219,11 @@ class ApplicationHelperTest < HelperTestCase
     assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---')
   end
   
+  def test_acronym
+    assert_equal '<p>This is an acronym: <acronym title="American Civil Liberties Union">ACLU</acronym>.</p>',
+                 textilizable('This is an acronym: ACLU(American Civil Liberties Union).')
+  end
+  
   def test_footnotes
     raw = <<-RAW
 This is some text[1].