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

Abstract at level > 1 #4

Closed
twsh opened this issue Apr 26, 2023 · 2 comments
Closed

Abstract at level > 1 #4

twsh opened this issue Apr 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@twsh
Copy link

twsh commented Apr 26, 2023

A heading with a level of greater than 1 is ignored by the filter. This causes me a problem if I run Pandoc with --shift-heading-level-by=1. Is there a good reason for the restriction to level 1 headings? If not, could it be removed entirely, or replaced with, e.g., block.level <= 2?

@tarleb
Copy link
Member

tarleb commented Apr 27, 2023

There were two reason: The first is simplicity, in that the code is slightly shorter if we assume the abstract to be at the top level. The other is that it would seem unnatural to remove nested contents.

That second reason doesn't apply with --shift-heading-level-by, and the first one isn't all that strong. We could check that the level is not lower than any header we've seen so far, which would be easy to do but would still ensure that we don't remove a nested section.

@tarleb tarleb added the enhancement New feature or request label Apr 27, 2023
@tarleb tarleb closed this as completed in 0ecb36f Apr 27, 2023
@twsh
Copy link
Author

twsh commented Apr 27, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants