Skip to content

Commit

Permalink
Fixed empty block HTML disappearing. [#64 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber committed Oct 2, 2008
1 parent d543c7b commit ef86e86
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -20,6 +20,8 @@

* Fixed behavior of unclosed (multi-paragraph) quotes and incorrect handling of links inside double quotations. #59, #63

* Fixed empty block HTML disappearing. #64


*4.0.3 (August 18, 2008)*

Expand Down
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_inline.rl
Expand Up @@ -206,7 +206,7 @@ red_block(VALUE self, VALUE regs, VALUE block, VALUE refs)
VALUE sym_text = ID2SYM(rb_intern("text"));
VALUE btype = rb_hash_aref(regs, ID2SYM(rb_intern("type")));
block = rb_funcall(block, rb_intern("strip"), 0);
if ((RSTRING_LEN(block) > 0) && !NIL_P(btype))
if ((!NIL_P(block)) && !NIL_P(btype))
{
method = rb_intern(RSTRING_PTR(btype));
if (method == rb_intern("notextile")) {
Expand Down
2 changes: 1 addition & 1 deletion ext/redcloth_scan/redcloth_scan.rl
Expand Up @@ -296,7 +296,7 @@ int SYM_escape_preformatted, SYM_escape_attributes;
dl := |*
LF dt_start { ADD_BLOCK(); ASET(type, dt); };
dd_start { ADD_BLOCK(); ASET(type, dd); };
long_dd { INLINE(html, dd); };
long_dd { INLINE(html, dd); CLEAR_REGS(); };
block_end { ADD_BLOCK(); INLINE(html, dl_close); fgoto main; };
default => cat;
*|;
Expand Down
8 changes: 7 additions & 1 deletion test/html.yml
Expand Up @@ -296,4 +296,10 @@ html: |-
---
name: tilde in innerHTML is not altered
in: '<a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a>'
html: '<p><a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a></p>'
html: '<p><a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a></p>'
---
name: empty block
in: |-
<embed src="test.swf"></embed>
html: |-
<embed src="test.swf"></embed>

0 comments on commit ef86e86

Please sign in to comment.