-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
First-line-indent: fix bug with pre-existing header-includes #185
base: master
Are you sure you want to change the base?
Conversation
The filter crashed when the original document had header-includes already. This is now fixed, tested for all types of header-includes (MetaInlines, MetaBlocks and MetaList).
Did this problem crop up because of Pandoc's (several) recent changes to header include handling or has this always been a problem? |
Thanks. I'm not sure; I thought I had tested it on docs with header-includes and it worked. But it's also possible I overlooked it. Especially header-includes can have three types: MetaInlines, MetaBlocks and MetaList, and I may have failed to try it with all of them. I've now tested the new version with all. I haven't included sample .md files for all cases but could do if that's helpful for the future. |
Thanks for the response, and that's fair. Actually I think including test fixtures would be quite helpful in this case. |
What I usually do is to check if `header-includes` is `nil`, a MetaList or
something else. If it is a MetaList I just push my additions onto it as a
MetaBlocks containing a RawBlock; otherwise I replace it with a MetaList
and push the original value if any and my own …Block onto it. Has never
failed so far (unless the --include-in-header option has been used.)
Just my two worthless coins.
Den ons 7 juli 2021 17:53Julien Dutant ***@***.***> skrev:
… Thanks. I'm not sure; I thought I had tested it on docs with
header-includes and it worked. But it's also possible I overlooked it.
Especially header-includes can have three types: MetaInlines, MetaBlocks
and MetaList, and I may have failed to try it with all of them. I've now
tested the new version with all. I haven't included sample .md files for
all cases but could do if that's helpful for the future.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI3OU2HY6R4REK5M6FZJADTWRZ5FANCNFSM47ZNDS4Q>
.
|
@bpj Thanks. That's right; this filter does the same, except that it first creates a MetaList with the desired content as MetaBlocks containing a Rawblock, then check if there's something in the original doc's Meta; if yes, then either it's a MetaList and we extend ours with it, or it's something else and we push it in ours. @alerque I've added three sample docs covering the different types of header-includes. |
The first-line-indent filter crashed when the original document had header-includes already. This is now fixed, tested for all types of header-includes (MetaInlines, MetaBlocks and MetaList).