Strange --section-div
behavior
#9559
Replies: 3 comments 1 reply
-
Please give an example of the input you're using, and the command (input format and options). |
Beta Was this translation helpful? Give feedback.
-
We run the following PandocRuby command:
which should be equivalent to:
We use markdown files as input. We also have custom ruby extensions (tags) in the source content, which get resolved into various types of HTML. So the input that gets passed to Pandoc looks something like this:
This is an example of a content extract where the heading issue occurs. If you want to see the full content, we prepared a "half-built" file with our custom tags processed into HTML, but before the Pandoc conversion. This is exactly what should be passed to Pandoc as input: |
Beta Was this translation helpful? Give feedback.
-
See the documentation for the |
Beta Was this translation helpful? Give feedback.
-
We are using PandocRuby in a Jekyll project, and have encountered some confusing conversion behavior with headings, their ID attributes, and sections.
For a small minority of our headings, the surrounding
<div>
around a heading is replaced by a<section>
tag, and theid
attribute of the<h>
tag is moved to the<section>
. For example:Expected/correct example:
Issue example:
We haven't been able to 100% identify what causes this to happen, but all cases are headings that directly start after a wrapping
<div>
element. For example when using Pandoc columns or our own custom tags that render divs.This type of behavior seems to match the description of the --section-divs Pandoc option. However, it's definitely not happening for all headings, or even all headings that are placed at the start of divs. Also, we definitely don't have this option enabled. When we tried enabling/adding
--section-divs
, then the described behavior happens for basically all headings.Can you think of an explanation for this behavior, or a way to fix it?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions