I found the culprit: it was compress html, automatically included by just-the-docs
With this identified, there are a number of ways to fix my issue:
- The simplest: just add the following to
_config.yml
with this compress html will only remove blank lines, which fixes my issue as there are no blank lines in the generated code blocks.compress_html: blanklines: true
- Use a page/layout that inherits from nothing for the relevant pages. This isn’t really satisfactory as it means copying the whole just-the-docs layout to your new layout.
- Edit
_layout/vendor/compress.html
to allow for per page/layout configuration. I opened an issue which mentions the edits I performed to have a way to toggle it off or switch it to blanklines mode on a page/layout basis. See this commit for my implementation of it (Important files:_layout/vendor/compress.html
and the frontmatter of_layout/odoc.html
)