pandoc-ext/abstract-section

Abstract at level > 1

twsh opened this issue · 2 comments

twsh commented

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?

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.

twsh commented

Thank you!