Skip to content

Commit

Permalink
Allow emphasized phrases to include underscores. [#110 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber committed May 30, 2009
1 parent 9a4c377 commit 634a79d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,5 +1,7 @@
=== Edge

* Allow emphasized phrases to include underscores. [Jason Garber]

* Include an ending question mark in a citation. [Jason Garber]

* Preserve leading whitespace in pre and bc blocks. [Jason Garber]
Expand Down
6 changes: 4 additions & 2 deletions ext/redcloth_scan/redcloth_inline.rl
Expand Up @@ -48,8 +48,10 @@
script_tag = ( "<script" [^>]* ">" (default+ -- "</script>") "</script>" LF? ) >X >A %T ;
strong = "["? "*" >X mtext >A %T :> "*" "]"? ;
b = "["? "**" >X mtext >A %T :> "**" "]"? ;
em = "["? "_" >X mtext >A %T :> "_" "]"? ;
i = "["? "__" >X mtext >A %T :> "__" "]"? ;
mtext_excluding_underscore = mtext -- "_" ;
emtext = mtext_excluding_underscore ("_" mtext_excluding_underscore)*;
em = "["? "_" >X emtext >A %T "_" "]"? ;
i = "["? "__" >X emtext >A %T :>> ("__" "]"?) ;
del = "[-" >X C ( mtext ) >A %T :>> "-]" ;
emdash_parenthetical_phrase_with_spaces = " -- " mtext " -- " ;
del_phrase = (( " " >A %{ STORE("beginning_space"); } "-" | "-" when starts_line) >X C ( mtext ) >A %T :>> ( "-" end_markup_phrase )) - emdash_parenthetical_phrase_with_spaces ;
Expand Down
10 changes: 9 additions & 1 deletion spec/fixtures/basic.yml
Expand Up @@ -949,7 +949,7 @@ in: |-
Some more text.
html: |-
<p>Just some <em>_</em> text</p>
<p>Just some ___ text</p>
<hr />
<p>Some more text.</p>
---
Expand Down Expand Up @@ -988,3 +988,11 @@ name: citation including question mark
in: "??What's the Matter with Kansas? How Conservatives Won the Heart of America?? is a great book!"
html: |-
<p><cite>What&#8217;s the Matter with Kansas? How Conservatives Won the Heart of America</cite> is a great book!</p>
---
name: emphasized word including underscore
in: |-
_trythis_ it will keep the empahsis.
_and_this_too_ it should keep the emphasis but does not with redcloth.
html: |-
<p><em>trythis</em> it will keep the empahsis.<br />
<em>and_this_too</em> it should keep the emphasis but does not with redcloth.</p>

0 comments on commit 634a79d

Please sign in to comment.