8000 [Docx Reader] Explicit spans disablinig inline styles for docx+styles by lierdakil · Pull Request #6511 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Docx Reader] Explicit spans disablinig inline styles for docx+styles #6511

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
@lierdakil lierdakil commented Jul 7, 2020

During discussion in #6501 another interesting issue was brought to my attention. When reading docx+styles, pandoc fails to indicate if inline run styles are explicitly disabled, for instance:
"Underlined" where "der" is not underlined
here, a character style applied to the whole string defines underlined style, but for der that is explicitly disabled inline. Currently, pandoc doesn't handle this at all: pandoc -f docx+styles -t markdown /tmp/test.docx outputs

::: {custom-style="Normal"}
[Underlined]{custom-style="Hyperlink-custom"}
:::

which is strictly speaking incorrect.

This PR adds explicit annotations for such runs via spans with classes .no-emph, .no-strong, etc, so that the output becomes

::: {custom-style="Normal"}
[Un[der]{.no-underline}lined]{custom-style="Hyperlink-custom"}
:::

This is more of a proposal, so I'm marking this as draft.

With HTML, this works only partially: while italic, bold and smallcaps all work well enough, strikeout and underline do not, because those two are styled via text-decoration which can not be overridden on child elements. Ideas welcome.

@lierdakil lierdakil force-pushed the docx-styles-negative-inlines branch from a48ad89 to 82bb1d3 Compare July 7, 2020 15:00
@lierdakil lierdakil force-pushed the docx-styles-negative-inlines branch 4 times, most recently from 816f782 to 91fac9f Compare July 13, 2020 18:15
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