Skip to content

Commit

Permalink
Closing HTML tag can end paragraph, blockquote in place of double-ret…
Browse files Browse the repository at this point in the history
…urn. [#13 state:resolved]
  • Loading branch information
jgarber committed Jul 14, 2008
1 parent 549d6dd commit 1976e76
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ext/redcloth_scan/redcloth_scan.rl
Expand Up @@ -59,6 +59,7 @@ int SYM_escape_preformatted;
html_start = indent >B %{STORE_B(indent_before_start)} block_start_tag >B %{STORE_B(start_tag)} indent >B %{STORE_B(indent_after_start)} ;
html_end = indent >B %{STORE_B(indent_before_end)} block_end_tag >B %{STORE_B(end_tag)} (indent LF?) >B %{STORE_B(indent_after_end)} ;
standalone_html = indent (block_start_tag | block_empty_tag | block_end_tag) indent LF+;
html_end_terminating_block = ( indent block_end_tag ) >A @{ p = reg - 1; } ;

# tables
para = ( default+ ) -- LF ;
Expand Down Expand Up @@ -219,6 +220,18 @@ int SYM_escape_preformatted;
fgoto main;
}
};
html_end_terminating_block {
if (NIL_P(extend)) {
ADD_BLOCK();
INLINE(html, bq_close);
fgoto main;
} else {
ADD_EXTENDED_BLOCK();
INLINE(html, bq_close);
END_EXTENDED();
fgoto main;
}
};
default => cat;
*|;

Expand All @@ -245,6 +258,16 @@ int SYM_escape_preformatted;
fgoto main;
}
};
html_end_terminating_block {
if (NIL_P(extend)) {
ADD_BLOCK();
fgoto main;
} else {
ADD_EXTENDED_BLOCK();
END_EXTENDED();
fgoto main;
}
};
LF list_start {
ADD_BLOCK();
list_layout = rb_ary_new();
Expand Down
22 changes: 22 additions & 0 deletions test/html.yml
Expand Up @@ -247,3 +247,25 @@ html: |-
;var i,c,x;while(eval(kode));}hivelogic_enkoder();
/* ]]> */
</script>.</p>
---
name: HTML end tag can end paragraph
in: |-
<div>
This is a paragraph.
</div>
html: |-
<div>
<p>This is a paragraph.</p>
</div>
---
name: HTML end tag can end blockquote
in: |-
<div>
bq. This is a blockquote.
</div>
html: |-
<div>
<blockquote>
<p>This is a blockquote.</p>
</blockquote>
</div>

0 comments on commit 1976e76

Please sign in to comment.