Pandoc: lists may disappear when reading from html

Created on 5 Mar 2017  Â·  9Comments  Â·  Source: jgm/pandoc

When I convert the file

<div>
Some text
<ul>
<li>element</li>
</ul>
</div>

from html to pandoc markdown the result is

<div>

Some text - first

</div>

Which is then converted back to

<div>
<p>Some text - first</p>
</div>

This behavior is not expected by my side. I expect to get the same result. Or is this behavior expected? Then why? Cause the first code is valid, but pandoc represents content without list.

Markdown writer

All 9 comments

I can reproduce this issue. Minimal example:

$ pandoc -f native -t markdown

[ Plain [Str "Some",Space,Str "text"]
, BulletList [[Plain [Str "element"]]]
]


Some text
-   element

The markdown writer should always put a blank line in front of a list.

@mb21 Please form sentences, I simply don't understand what you want.

@danieltuzes sorry, I edited my comment...

The markdown writer should always put a blank line in front of a list.

Not always...we don't want a blank line in front of a sublist in a tight nested list, for example.

@danieltuzes - what version of pandoc are you using?

With current HEAD we get different output (see @mb21's example), but there's still a problem because there's no blank line before the list.

I use pandoc 1.19.2.1 Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4

Probably it would work to make the following transformation in the Markdown writer:

convert Plain before anything but a RawBlock to Para, unless (a) the following block is a list and (b) the immediate parent of the Plain element is a list.

@jgm Could you please inform me what do you suggest me to do? Or do you agree that this behavior in not intended and I shall wait for the next version of Pandoc?

It will be fixed in the next version.

+++ danieltuzes [Mar 08 17 03:52 ]:

[1]@jgm Could you please inform me what do you suggest me to do? Or do
you agree that this behavior in not intended and I shall wait for the
next version of Pandoc?

—
You are receiving this because you were mentioned.
Reply to this email directly, [2]view it on GitHub, or [3]mute the
thread.

References

  1. https://github.com/jgm
  2. https://github.com/jgm/pandoc/issues/3487#issuecomment-285021513
  3. https://github.com/notifications/unsubscribe-auth/AAAL5FjrQ74fPB8fHBIWOll1r7wlJTELks5rjpZtgaJpZM4MTcZh
Was this page helpful?
0 / 5 - 0 ratings

Related issues

krobelus picture krobelus  Â·  4Comments

RLesur picture RLesur  Â·  3Comments

timtroendle picture timtroendle  Â·  3Comments

guifh picture guifh  Â·  4Comments

naught101 picture naught101  Â·  5Comments