Skip to content

Instantly share code, notes, and snippets.

@kentonv
Created May 14, 2013 20:02
Show Gist options
  • Save kentonv/5579014 to your computer and use it in GitHub Desktop.
Save kentonv/5579014 to your computer and use it in GitHub Desktop.
kenton@megaman:~/workspace/capnproto/doc:master$ echo -e '<div><span>@Foo</span>\n\n</div>' | maruku
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Malformed HTML starting at "<div><span>@Foo</span>"
| ---------------------------------------------------------------------------
| <div><span>@Foo</span>EOF
| |---------------------------------------------------------------------------
| +--- Byte 0
| Shown bytes [0 to 22] of 22:
| ><div><span>@Foo</span>
|
| At line 2
| text |<div><span>@Foo</span>|
| empty --> ||
| raw_html |</div>|
|
|
| Elements read in span:
+---------------------------------------------------------------------------
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:49:in `maruku_error'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:476:in `read_inline_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:122:in `read_span'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:36:in `parse_lines_as_span'
\___________________________________________________________________________
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| REXML cannot parse this block of HTML/XML:
| |<marukuwrap><div><span>@Foo</span></marukuwrap>
| #<REXML::ParseException: #<REXML::ParseException: Missing end tag for 'div' (got "marukuwrap")
| Line: 1
| Position: 47
| Last 80 unconsumed characters:
| >
| /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:335:in `pull_event'
| /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:183:in `pull'
| /usr/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:22:in `parse'
| /usr/lib/ruby/1.9.1/rexml/document.rb:243:in `build'
| /usr/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:93:in `new'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:93:in `md_html'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:484:in `read_inline_html'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:122:in `read_span'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:36:in `parse_lines_as_span'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:275:in `read_paragraph'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:158:in `read_text_material'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:69:in `parse_blocks'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_doc.rb:55:in `parse_doc'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/maruku.rb:30:in `initialize'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `new'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `block in <top (required)>'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `each'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `<top (required)>'
| /usr/local/bin/maruku:23:in `load'
| /usr/local/bin/maruku:23:in `<main>'
| ...
| Missing end tag for 'div' (got "marukuwrap")
| Line: 1
| Position: 47
| Last 80 unconsumed characters:
|
| Line: 1
| Position: 47
| Last 80 unconsumed characters:
| >
+---------------------------------------------------------------------------
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:56:in `maruku_recover'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:97:in `rescue in md_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:85:in `md_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:484:in `read_inline_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:122:in `read_span'
\___________________________________________________________________________
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Bad block-level HTML:
| |#<MaRuKu::Exception: Error: Malformed: closing tag "div" in empty list
| |HTML READER
| | state=inside_element match="</div>"
| |Tag stack = []
| |Before:
| ||</div>
| |After:
| |
| |>/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/html_helper.rb:147:in `handle_tag'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/html_helper.rb:79:in `eat_this'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:238:in `read_raw_html'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:88:in `parse_blocks'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_doc.rb:55:in `parse_doc'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/maruku.rb:30:in `initialize'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `new'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `block in <top (required)>'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `each'
| |/var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `<top (required)>'
| |/usr/local/bin/maruku:23:in `load'
| |/usr/local/bin/maruku:23:in `<main>'
|
| At line 4
| text |<div><span>@Foo</span>|
| empty ||
| raw_html |</div>|
+---------------------------------------------------------------------------
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:49:in `maruku_error'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:247:in `rescue in read_raw_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:237:in `read_raw_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:88:in `parse_blocks'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
\___________________________________________________________________________
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| REXML cannot parse this block of HTML/XML:
| |<marukuwrap></div></marukuwrap>
| #<REXML::ParseException: #<REXML::ParseException: Missing end tag for 'marukuwrap' (got "div")
| Line: 1
| Position: 31
| Last 80 unconsumed characters:
| >
| /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:335:in `pull_event'
| /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:183:in `pull'
| /usr/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:22:in `parse'
| /usr/lib/ruby/1.9.1/rexml/document.rb:243:in `build'
| /usr/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:93:in `new'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:93:in `md_html'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:255:in `read_raw_html'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:88:in `parse_blocks'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_doc.rb:55:in `parse_doc'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/maruku.rb:30:in `initialize'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `new'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:113:in `block in <top (required)>'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `each'
| /var/lib/gems/1.9.1/gems/maruku-0.6.1/bin/maruku:106:in `<top (required)>'
| /usr/local/bin/maruku:23:in `load'
| /usr/local/bin/maruku:23:in `<main>'
| ...
| Missing end tag for 'marukuwrap' (got "div")
| Line: 1
| Position: 31
| Last 80 unconsumed characters:
|
| Line: 1
| Position: 31
| Last 80 unconsumed characters:
| >
+---------------------------------------------------------------------------
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:56:in `maruku_recover'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:97:in `rescue in md_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/helpers.rb:85:in `md_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:255:in `read_raw_html'
!/var/lib/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:88:in `parse_blocks'
\___________________________________________________________________________
Wrapping bad html in a PRE with class 'markdown-html-error'
|<div><span>@Foo</span>Wrapping bad html in a PRE with class 'markdown-html-error'
|</div><p><pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>REXML could not parse this XML/HTML:
&lt;div&gt;&lt;span&gt;@Foo&lt;/span&gt;</pre></p>
<pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>REXML could not parse this XML/HTML:
&lt;/div&gt;</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment