bhollis/maruku

Multiple lines for HTML <li>-tag

MartinThoma opened this issue · 2 comments

Maruku seems to have problems with this:

   tttttt
    <ul>
      <li>**sdf**: adfasdf
          adfasd fasdfa asdfasdf 
          adfasd dsfadsf a</li>
    </ul>

I get:

 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Malformed HTML starting at "<ul>"
| ---------------------------------------------------------------------------
| <ul>EOF
| |---------------------------------------------------------------------------
| +--- Byte 0
| Shown bytes [0 to 4] of 4:
| ><ul>
| 
| At line 13
|       text     |bla bla.|
|      empty     ||
|       text     |tttttt:|
|   raw_html --> |<ul>|
|   raw_html     |  <li>**sdf**: asdfasdf|
|       code     |      adsfasdf |
|       code     |      adsasdf|
| 
| 
| Elements read in span: 
|  -
|
+---------------------------------------------------------------------------
!/var/lib/gems/1.9.1/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:423:in `read_inline_html'
!/var/lib/gems/1.9.1/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:94:in `read_span'
!/var/lib/gems/1.9.1/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:14:in `parse_span'
!/var/lib/gems/1.9.1/gems/maruku-0.7.0/lib/maruku/input/parse_block.rb:284:in `read_paragraph'
\___________________________________________________________________________

edit: The problem is still there with

   tttttt
    <ul>
      <li><b>sdf</b>: adfasdf
          adfasd fasdfa asdfasdf 
          adfasd dsfadsf a</li>
    </ul>

so it's not a HTML/Markdown combination problem, but rather the multiline li-tag.

Thanks, I'll look into it. In the meantime, you can fix this by including a newline after your tttttt:

tttttt

<ul>
  <li>**sdf**: adfasdf
      adfasd fasdfa asdfasdf
      adfasd dsfadsf a</li>
</ul>

Note that the markdown inside <li> won't get processed unless you write it like this:

tttttt

<ul>
  <li markdown='1'>**sdf**: adfasdf
      adfasd fasdfa asdfasdf
      adfasd dsfadsf a</li>
</ul>

I'm actually going to resolve this - for consistent results among Markdown processors, include a newline before block HTML. Or, just write the whole thing in Markdown:

tttttt

* **sdf**: adfasdf adfasd fasdfa asdfasdf adfasd dsfadsf a