Closed lollipopman closed 5 years ago
Possibly an issue in Text.Pandoc.Pretty.
Isn't this what --wrap
is for?
$ pandoc -f gfm -t gfm --wrap=none <<EOF
> - The next line should be joined
> here.
> - asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> EOF
- The next line should be joined here.
- asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
My previous comment could be a workaround as I believe that the default --wrap=auto
should also yield the expected result, but it doesn't:
$ pandoc -f gfm -t gfm --wrap=auto --columns=72 <<EOF
> - The next line should be joined
> here.
> - asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> EOF
- The next line should be joined
here.
- asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
EDIT: note that if the second list item line isn't as long, the wrapping works correctly
If anyone wants to diagnose this, I'd do it by using traceShowId
from Debug.Trace
to inspect the Doc
produced by the markdown writer before it is rendered. Then try to reproduce the issue directly with Text.Pandoc.Pretty
.
Ignore that: it's gfm
, so libcmark
is doing the formatting/wrapping.
Nothing to do with any code in pandoc itself.
This can be reproduced with the cmark
executable:
% ./cmark -t commonmark --width 80
- the next line should be joined
here
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- the next line should be joined
here
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
So the issue should really be reported to cmark
Never mind, I just fixed this on cmark. The fix will propagate to pandoc after the cmark change floats up to cmark-gfm and then the gfm haskell wrapper.
When a list item has a word that extends beyond the column setting, the previous list entry is not wrapped correctly:
test:
expected output:
version: