diff --git a/CHANGELOG b/CHANGELOG index 008b35a8..032f9bca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* Fixed link references/aliases not being recognized when they include hyphens. #36 + * Dimensions in feet and inches use correct typographic characters. #25 * Limit overzealous superscript and subscript. Sup/sub phrases must be surrounded by spaces or square brackets, as in Textile 2. #35 diff --git a/ext/redcloth_scan/redcloth_scan.rl b/ext/redcloth_scan/redcloth_scan.rl index 060ef3c4..c958dae1 100644 --- a/ext/redcloth_scan/redcloth_scan.rl +++ b/ext/redcloth_scan/redcloth_scan.rl @@ -45,7 +45,7 @@ int SYM_escape_preformatted, SYM_escape_attributes; long_dd = dd_start " "* LF %{ ADD_BLOCK(); ASET(type, dd); } any+ >A %{ TRANSFORM(text) } :>> "=:" ; dl_start = (dt_start mtext (LF dt_start mtext)* " "* dd_start) ; blank_line = LF; - link_alias = ( "[" >{ ASET(type, ignore) } %A phrase %T "]" %A uri %{ STORE_URL(href); } ) ; + link_alias = ( "[" >{ ASET(type, ignore) } %A chars %T "]" %A uri %{ STORE_URL(href); } ) ; # image lookahead IMG_A_LEFT = "<" %{ ASET(float, left) } ; diff --git a/test/links.yml b/test/links.yml index 765c51d6..3a884398 100644 --- a/test/links.yml +++ b/test/links.yml @@ -221,3 +221,11 @@ name: quotes and follow link in: 'Some "text" followed by a "link":http://redcloth.org.' html: '

Some “text” followed by a link.

' lite_mode_html: 'Some “text” followed by a link.' +--- +name: link alias containing dashes +in: |- + "link":google-rocks + + [google-rocks]http://google.com +html: |- +

link

\ No newline at end of file