@@ -401,22 +401,22 class RedCloth3 < String | |||||
401 | # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing |
|
401 | # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing | |
402 | # [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing |
|
402 | # [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing | |
403 | # [ /\'/, '‘' ], # single opening |
|
403 | # [ /\'/, '‘' ], # single opening | |
404 |
|
|
404 | # [ /</, '<' ], # less-than | |
405 |
|
|
405 | # [ />/, '>' ], # greater-than | |
406 | # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing |
|
406 | # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing | |
407 | # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing |
|
407 | # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing | |
408 | # [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing |
|
408 | # [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing | |
409 | # [ /"/, '“' ], # double opening |
|
409 | # [ /"/, '“' ], # double opening | |
410 |
|
|
410 | # [ /\b( )?\.{3}/, '\1…' ], # ellipsis | |
411 | [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym |
|
411 | [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym | |
412 |
|
|
412 | # [ /(^|[^"][>\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 | |
413 |
|
|
413 | # [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash | |
414 |
|
|
414 | # [ /\s->\s/, ' → ' ], # right arrow | |
415 |
|
|
415 | # [ /\s-\s/, ' – ' ], # en dash | |
416 |
|
|
416 | # [ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign | |
417 |
|
|
417 | # [ /\b ?[(\[]TM[\])]/i, '™' ], # trademark | |
418 |
|
|
418 | # [ /\b ?[(\[]R[\])]/i, '®' ], # registered | |
419 |
|
|
419 | # [ /\b ?[(\[]C[\])]/i, '©' ] # copyright | |
420 | ] |
|
420 | ] | |
421 |
|
421 | |||
422 | H_ALGN_VALS = { |
|
422 | H_ALGN_VALS = { | |
@@ -1010,7 +1010,7 class RedCloth3 < String | |||||
1010 |
|
1010 | |||
1011 | def glyphs_textile( text, level = 0 ) |
|
1011 | def glyphs_textile( text, level = 0 ) | |
1012 | if text !~ HASTAG_MATCH |
|
1012 | if text !~ HASTAG_MATCH | |
1013 |
|
|
1013 | pgl text | |
1014 | footnote_ref text |
|
1014 | footnote_ref text | |
1015 | else |
|
1015 | else | |
1016 | codepre = 0 |
|
1016 | codepre = 0 |
@@ -219,6 +219,11 class ApplicationHelperTest < HelperTestCase | |||||
219 | assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---') |
|
219 | assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---') | |
220 | end |
|
220 | end | |
221 |
|
221 | |||
|
222 | def test_acronym | |||
|
223 | assert_equal '<p>This is an acronym: <acronym title="American Civil Liberties Union">ACLU</acronym>.</p>', | |||
|
224 | textilizable('This is an acronym: ACLU(American Civil Liberties Union).') | |||
|
225 | end | |||
|
226 | ||||
222 | def test_footnotes |
|
227 | def test_footnotes | |
223 | raw = <<-RAW |
|
228 | raw = <<-RAW | |
224 | This is some text[1]. |
|
229 | This is some text[1]. |
General Comments 0
You need to be logged in to leave comments.
Login now