Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML table to contains list #379

Closed
wants to merge 8 commits into from
Closed

HTML table to contains list #379

wants to merge 8 commits into from

Conversation

qzchenwl
Copy link

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
Copy link
Owner

jgm commented Jan 28, 2012

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
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants