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

text between two display style formulas was removed #8483

Closed
redstoneleo opened this issue Dec 12, 2022 · 9 comments
Closed

text between two display style formulas was removed #8483

redstoneleo opened this issue Dec 12, 2022 · 9 comments
Labels

Comments

@redstoneleo
Copy link

Explain the problem.
Text between two display style formulas was removed, only formulas left.
Command:
pandoc.exe aa.docx --self-contained --mathjax -o example35.html
File:
aa.docx

Pandoc version?
Latest version pandoc on win11.

@jgm
Copy link
Owner

jgm commented Dec 12, 2022

Thanks for the report. It looks like here we have an oMathPara as a child of a w:p node.
This is legal OOXML, but it looks like the docx reader is expecting an oMathPara to be a block by itself, not in a paragraph.

T.P.Readers.Docx.Parse.hs line 704:

elemToBodyPart :: NameSpaces -> Element -> D BodyPart
elemToBodyPart ns element
  | isElem ns "w" "p" element
  , (c:_) <- findChildrenByName ns "m" "oMathPara" element = do
      expsLst <- eitherToD $ readOMML $ showElement c
      return $ OMathPara expsLst

This code essentially throws away anything in the w:p besides the oMathPara.
It would be good to fix this -- @jkr do you see a good way to do that?

@jgm
Copy link
Owner

jgm commented Dec 12, 2022

To clarify, oMathPara can be a child of w:p but it can also be a child of w:body -- so in pandoc terms, it can be used in either a "block" or an "inline" context.

We should recognize both of these.

@jgm jgm closed this as completed in 3439c1a Dec 12, 2022
@jgm
Copy link
Owner

jgm commented Dec 12, 2022

OK, I think the fix was fairly straightforward. @jkr feel free to modify if this doesn't seem right.

@redstoneleo
Copy link
Author

Thanks very much ! Any plan to give a new release ?

@jgm
Copy link
Owner

jgm commented Dec 12, 2022

I expect there will be a new release in the next few weeks.
Til then you can use a nightly (after tonight anyway).

@redstoneleo
Copy link
Author

where is the nightly ?

@jgm
Copy link
Owner

jgm commented Dec 12, 2022

Actions / Nightly tab on left

@redstoneleo
Copy link
Author

@jgm
Copy link
Owner

jgm commented Dec 12, 2022

Rebuilt: https://github.com/jgm/pandoc/actions/runs/3673742995

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