Skip to content

Commit

Permalink
Fixed link references/aliases not being recognized when they include …
Browse files Browse the repository at this point in the history
…hyphens.

Changed link alias pattern to include punctuation. [#36 state:resolved]
  • Loading branch information
jgarber committed Aug 15, 2008
1 parent 1f8bea1 commit 3723cc3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_scan.rl
Expand Up @@ -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) } ;
Expand Down
8 changes: 8 additions & 0 deletions test/links.yml
Expand Up @@ -221,3 +221,11 @@ name: quotes and follow link
in: 'Some "text" followed by a "link":http://redcloth.org.'
html: '<p>Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.</p>'
lite_mode_html: 'Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.'
---
name: link alias containing dashes
in: |-
"link":google-rocks
[google-rocks]http://google.com
html: |-
<p><a href="http://google.com">link</a></p>

0 comments on commit 3723cc3

Please sign in to comment.