Skip to content

Fix pandoc#1588

Open
jochenklar wants to merge 3 commits into2.4.5/releasefrom
2.4.5/fix/pandoc
Open

Fix pandoc#1588
jochenklar wants to merge 3 commits into2.4.5/releasefrom
2.4.5/fix/pandoc

Conversation

@jochenklar
Copy link
Copy Markdown
Member

This PR fixes the display of images when exporting via Pandoc (which nobody noticed yet...).

It also fixes test_get_pandoc_content, which failed on more recent pandoc versions (which appearantly got pickier when they cannot find images to include).

@jochenklar jochenklar changed the base branch from main to 2.4.5/release April 19, 2026 11:15
@jochenklar jochenklar added this to the RDMO 2.4.5 milestone Apr 19, 2026
@jochenklar jochenklar requested a review from MyPyDavid April 19, 2026 11:17
@jochenklar jochenklar self-assigned this Apr 19, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 19, 2026

Coverage Status

Coverage is 94.897%2.4.5/fix/pandoc into 2.4.5/release. No base build found for 2.4.5/release.

Comment thread rdmo/core/pandoc.py
pandoc_version = get_pandoc_version()
pandoc_args = list(settings.EXPORT_PANDOC_ARGS.get(export_format, [])) # without list(), settings would be changed

if pandoc_version < Version('2'):
Copy link
Copy Markdown
Member

@MyPyDavid MyPyDavid Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is something going on with these multiple --resourse-path args, https://pandoc.org/releases.html#pandoc-2.12-2021-03-08.
So maybe increase the minimum version to explicitly to 2.12??

from GPT:

get_pandoc_args() now requires only pandoc >= 2.0, but it may pass --resource-path multiple times. That only became safe in Pandoc 2.12; before that, the last --resource-path replaced earlier ones. So with Pandoc 2.0–2.11, STATIC_ROOT can be silently dropped when context["resource_path"] is present.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, it seems it was broken all the time (for pandoc < 2.12). The correct way is to combine the path with : (or ; on Windows), which is os.pathsep. See also jgm/pandoc#6152 (comment). I also fixed the test a bit to use proper pathlib.Path to also work in Windows.

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.

3 participants