-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Make multiple initial list levels work for docx #6522
Conversation
Most certainly. How else would one check that the docx produced by pandoc matches the expected? Granted, not very flexible, but neither is docx. The code looks fine (provided Word renders the document as expected), although I'd suggest using record syntax for matching Also, why |
bd0de3c
to
4356b86
Compare
Sorry for the long delay. I have updated the PR with your suggestions and added tests. The resulting docx-file rendered fine in Word. |
I realized this PR has been lying here for a while now. It is ready for review, how would I best notify someone that it can be looked at? Should I assign someone myself? I'm pinging you here now, but I'm asking for future contributions I hope to make :-) @lierdakil @jgm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
One could remove a tiny bit of repetition by defining
let isListBlock = \case
BulletList {} -> True
OrderedList {} -> True
_ -> False
and using an if ... then ... else ...
term instead of a case
. I think that's a little cleaner, but it's a matter of taste.
If the first element of a bulleted or ordered list is another list, then that first item will disappear if the target format is docx. This changes the docx writer so that it prepends an empty string for those cases. With this, no items will disappear.
4356b86
to
7ac7dce
Compare
I've updated the PR :) |
Perfect, thank you! |
Hi, is this an okay way to solve #5948 ?
I'm not sure how what the best way to test this would be. The existing docx tests seem to use golden copies, is that the way to go here too?