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

org -> rst, linebreak issue in bullet lists with inline code #10730

Closed
nbehrnd opened this issue Mar 27, 2025 · 1 comment
Closed

org -> rst, linebreak issue in bullet lists with inline code #10730

nbehrnd opened this issue Mar 27, 2025 · 1 comment
Labels

Comments

@nbehrnd
Copy link
Contributor

nbehrnd commented Mar 27, 2025

Explain the problem.

With Emacs version 30.1 as packaged for Linux Debian 13/trixie started by emacs -q minimal.org without any additional packages, I prepare an Emacs orgmode file (cf. zip archive attached below) including a bullet list. By default, if a line becomes overly long to be displayed in the frame, the key chord M-S-q (meta/Alt key + shift + q) allows to fold the line to fit again into the frame; and if the line is within a bullet list, the indentation of this new line automatically reflects the level of hierarchy. This is retained in pandoc's conversion to rst with the optional "autowrap" the test page summarizes with pandoc --from org --to rst --standalone --no-highlight.

Like "normal running text", lines in bullet lists equally may include brief snippets/keywords of code enclosed by a pair of =, or ~ pandoc converts into pairs of two back ticks.

The conversion however fails if a brief snippet of code including white space is right at the line break; the indentation is "off", a check of the trypandoc.rst generated by the test page with rstcheck (version 6.2.4) for instance reports

$ rstcheck trypandoc.rst 
trypandoc.rst:7: (WARNING/2) Inline literal start-string without end-string.
trypandoc.rst:10: (WARNING/2) Inline literal start-string without end-string.
Error! Issues detected.

A conversion of the .rst file to pdf with rst2pdf (here version 0.102) passes with errors reported back to the CLI

$ rst2pdf trypandoc.rst 
trypandoc.rst:7: (WARNING/2) Inline literal start-string without end-string.
trypandoc.rst:10: (WARNING/2) Inline literal start-string without end-string.

and a less than optimal result.

The issue might be related to #4618 reported in May 2018

Pandoc version?

The observations relate to Pandoc version 3.6.4 as currently used by the project's test page.

2025-03-27_pandoc_org2rst.zip

@nbehrnd nbehrnd added the bug label Mar 27, 2025
nbehrnd added a commit to nbehrnd/datawarrior_clustersort that referenced this issue Mar 27, 2025
Because of a problem with pandoc's conversion of .org files to
yield .rst files,[1] the documentation within the Python wheel
will go on with (GitHub flavored) Markdown files.

[1] jgm/pandoc#10730

Signed-off-by: Norwid Behrnd <[email protected]>
@jgm
Copy link
Owner

jgm commented Mar 27, 2025

Thanks. I note this difference between the org and markdown readers:

% pandoc -t native -f org
=hi
there=
[ Para [ Code ( "" , [ "verbatim" ] , [] ) "hi\nthere" ] ]
% pandoc -t native -f markdown
`hi
there`
[ Para [ Code ( "" , [] , [] ) "hi there" ] ]

The markdown reader doesn't allow newlines to go into inline code; this avoids the problem at the reader level. So one solution is to make the org reader agree with this.

Another solution would be to have the RST writer convert any \n in inline code to spaces.

Or we could do both.

@jgm jgm closed this as completed in 3a0743e Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants