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

First-line-indent: fix bug with pre-existing header-includes #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jdutant
Copy link
Contributor

@jdutant jdutant commented Jul 4, 2021

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).

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).
@alerque
Copy link
Collaborator

alerque commented Jul 7, 2021

Did this problem crop up because of Pandoc's (several) recent changes to header include handling or has this always been a problem?

@jdutant
Copy link
Contributor Author

jdutant commented Jul 7, 2021

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.

@alerque
Copy link
Collaborator

alerque commented Jul 7, 2021

Thanks for the response, and that's fair.

Actually I think including test fixtures would be quite helpful in this case.

@bpj
Copy link

bpj commented Jul 8, 2021 via email

@jdutant
Copy link
Contributor Author

jdutant commented Jul 8, 2021

@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.

@alerque alerque assigned alerque and unassigned alerque Jul 8, 2021
@alerque alerque self-requested a review July 8, 2021 21:00
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.

3 participants