8000 [Docx Reader] Only honour the last seen paragraph style by lierdakil · Pull Request #5767 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Docx Reader] Only honour the last seen paragraph style #5767

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lierdakil
Copy link
Contributor

🚧 ⚠️ 🚨 Do not merge 🚨 ⚠️ 🚧

This PR is mostly intended for discussion related to #5738. The issue is, Word doesn't allow multiple paragraph styles being applied to a single paragraph. In my tests, both LibreOffice and Word (2013 and 2019) ignored all styles defined on the paragraph except the last one.

This PR basically makes Docx Reader do the same. The main question is, do we actually want to do that? This does actually simplify the code a tiny bit, but due to Writer writing multiple styles per paragraph in some cases, round-tripping through docx will sometimes create weird inconsistencies. This arguably is not a big issue, since opening and saving Writer's output with Word will lead to the same weird inconsistencies.

One test is failing. I chose not to update it. Technically, that test is not actually testing for anything particularly meaningful: only pandoc can produce a paragraph that has both Definition and Source Code styles, and such documents won't survive being edited by Word or LibreOffice. So the thing that test is supposed to test for is, well, frankly, not a real thing under a particular definition of "real". So I'm not sure how to update that test correctly, provided we decide this should be merged.

/cc @jkr
/cc @conklech (I believe you said something about actually round-tripping through docx in your workflow, so your input here might be enlightening)

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.

1 participant
0