HTML table to contains list #379

Closed
wants to merge 8 commits into
from

Projects

None yet

2 participants

@qzchenwl

For file table.html

<table>
  <tr>
    <td>
      <ul>
        <li>item1</li>
        <li>item2</li>
      </ul>
    </td>
  </tr>
</table>

pandoc.old -f html -t html table.html

<ul>
<li>item1</li>
<li>item2</li>
</ul>

pandoc.new -f html -t html table.html

<table>
<tbody>
<tr class="odd">
<td align="left"><ul>
<li>item1</li>
<li>item2</li>
</ul></td>
</tr>
</tbody>
</table>
@jgm
Owner

If you apply the patch, then do

pandoc -f html -t markdown | pandoc

on this input, you'll see why I had pPlain instead of block.

The problem is that we can't extract information about the widths of the table columns from the HTML. So we just set them all to 0, which pandoc interprets as meaning "just put the cells on one line and create a simple, not a multiline table".

I suppose that more general tables could be supported in HTML by assuming that all the columns are equal width, but that will often produce funny results.

@jgm
Owner
jgm commented Dec 9, 2013

The latest pandoc handles the original input as expected. Closing.

@jgm jgm closed this Dec 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment