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

Custom writers: fix handling of common state #9352

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented Jan 20, 2024

The CommonState (PANDOC_STATE in Lua) may change between the time that a custom writer script is first loaded and when the writer is run. However, the writer was always using the initial state, which led to problems, e.g. when the mediabag was updated in a filter, as those updates where not visible to the writer.

The state is now updated right before the writer function runs.

Fixes: #9229

The CommonState (`PANDOC_STATE` in Lua) may change between the time that
a custom writer script is first loaded and when the writer is run.
However, the writer was always using the initial state, which led to
problems, e.g. when the mediabag was updated in a filter, as those
updates where not visible to the writer.

The state is now updated right before the writer function runs.

Fixes: jgm#9229
@jgm jgm merged commit c2f7f5c into jgm:main Jan 20, 2024
9 of 12 checks passed
@tarleb tarleb deleted the lua-custom-writer-state branch January 20, 2024 19:03
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.

Trivial docx writer does not work in combination with pandoc.mediabag
2 participants