Skip to content

Commit

Permalink
Fix <notextile> blocks being included in following paragraph. [#119 s…
Browse files Browse the repository at this point in the history
…tate:resolved]
  • Loading branch information
jgarber committed May 27, 2009
1 parent a9d5f73 commit 200b459
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_common.rl
Expand Up @@ -94,7 +94,7 @@
code_tag_start = "<code" [^>]* ">" ;
code_tag_end = "</code>" ;

notextile = "<notextile>" >X (default+ -- "</notextile>") >A %T "</notextile>";
notextile = "<notextile>" >X LF? default+ >A %T :>> "</notextile>";

# URI tokens (lifted from Mongrel)
CTL = (cntrl | 127);
Expand Down
4 changes: 2 additions & 2 deletions ext/redcloth_scan/redcloth_scan.rl
Expand Up @@ -8,7 +8,7 @@
machine redcloth_scan;

# blocks
notextile_tag = notextile (LF | EOF) ;
notextile_tag = notextile (LF+ | EOF) ;
noparagraph_line_start = " "+ ;
notextile_block_start = ( "notextile" >A %{ STORE("type"); } A C :> "." ( "." %extend | "" ) " "+ ) %SET_ATTR ;
pre_tag_start = "<pre" [^>]* ">" (space* code_tag_start)? ;
Expand Down Expand Up @@ -165,7 +165,7 @@

main := |*
noparagraph_line_start { ASET("type", "ignored_line"); fgoto noparagraph_line; };
notextile_tag { INLINE(block, "notextile"); };
notextile_tag { INLINE(html, "notextile"); };
notextile_block_start { ASET("type", "notextile"); fgoto notextile_block; };
script_tag_start { CAT(block); fgoto script_tag; };
pre_tag_start { ASET("type", "notextile"); CAT(block); fgoto pre_tag; };
Expand Down
18 changes: 18 additions & 0 deletions spec/fixtures/basic.yml
Expand Up @@ -51,6 +51,24 @@ html: |-
<p>When the elephant comes to take a p. you&#8230;</p>
</blockquote>
---
name: notextile block
in: |-
Some text:
<notextile>
<div class="example"><pre>
Some code
</pre></div>
</notextile>
Some more text.
html: |-
<p>Some text:</p>
<div class="example"><pre>
Some code
</pre></div>
<p>Some more text.</p>
---
name: notextile block containing block start
in: |-
notextile. I saw a ship. It ate my elephant.
Expand Down

0 comments on commit 200b459

Please sign in to comment.