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

Preformated text in ordered list in a table adds blank line in reST #1777

Closed
lesserevil opened this issue Nov 25, 2014 · 1 comment
Closed

Comments

@lesserevil
Copy link

Input:

<html><head></head><body>
<p>
<table>
<tr><td>
TEXT<ol><li><pre>pre</pre></li></ol>
</td></tr>
</table>
</p>
</body></html>

Command:

pandoc -f html -t rst tmp.htm

Output:

+--------------------------------------------------------------------------+
| TEXT                                                                     |
|                                                                          |
| #. ::                                                                    |
|                                                                          |
|        pre                                                               |
|                                                                          |

+--------------------------------------------------------------------------+

There's an extraneous blank line in the table.

Tested with latest from git.

@lesserevil
Copy link
Author

Done a little more digging. Seems that ordered lists and unordered lists add a 'cr' a the end of each list element. If the list element also ends with a 'blankline' like a blockquote or a 'pre' block, then you get the extra empty line above. Removing the cr at the end of each list element removes the extra blank line, but has other consequences. I think removing the cr from the final list element will solve the problem. In src/Text/Pandoc/Writers/RST.hs, see lines 275, 286, and maybe 294 if the definitionList has the same issue.

My haskell is too weak to fix this in code.

@jgm jgm closed this as completed in 25e2c42 Nov 25, 2014
jgm added a commit that referenced this issue Nov 25, 2014
Now we do as before, including blank lines after list items in
loose lists (even though RST doesn't care -- this is just a matter
of visual appeal).  But we chomp any excess whitespace after the
last list item, which solves #1777.
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

No branches or pull requests

1 participant