khajavi / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

HTML nested sublists are not parsed correctly #215

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A nested list means the outer list is not rendered as a list: 

$ pandoc --from html --to markdown << EOF
>     <ol>
>       <li>
>         Main
>       </li>
>       <li>
>         List
>       </li>
>       <li>
>         Should
>       </li>
>       <li>
>         Be rendered
>       </li>
>       <ol>
>         <li>
>           Sub list
>         </li>
>         <li>
>           should be too
>         </li>
>       </ol>
>       <li>
>         last
>       </li>
>     </ol>
> EOF
Main
List
Should
Be rendered
1.  Sub list
2.  should be too

last

Original issue reported on code.google.com by cas...@gmail.com on 8 Feb 2010 at 3:56

GoogleCodeExporter commented 9 years ago
If I'm not mistaken, that's not valid HTML.  The inner <ol>...</ol> sublist 
needs to 
be within a <li>, like so:

<ol>
<li>outer 1</li>
<li>
  <ol>
    <li>inner 1</li>
    <li>inner 2</li>
  </ol>
</li>
<li>outer 2</li>
</ol>

If you don't believe me, try running your HTML through w3c's validator.

Original comment by fiddloso...@gmail.com on 8 Feb 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Ok, that may be true - but that was generated by google docs.  

I'll go find their issue tracker ;)

Original comment by cas...@gmail.com on 11 Feb 2010 at 4:01

GoogleCodeExporter commented 9 years ago
It's no wonder people get this wrong.  Look at W3C's example: 
http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.2

Original comment by cas...@gmail.com on 11 Feb 2010 at 4:04

GoogleCodeExporter commented 9 years ago
Well, since pandoc wants to be as permissive as possible, I think the thing to 
do is to 
change it so that it interprets an <ol>..</ol> inside a list as a 
<li><ol>...</ol></li>.
That way it won't matter if people make this mistake.  I can't see any downside 
to this.

Original comment by fiddloso...@gmail.com on 11 Feb 2010 at 6:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1836.

Original comment by fiddloso...@gmail.com on 12 Feb 2010 at 2:47