You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this bug using pandoc but I'm guessing it's a bug in this Haskell module.
I learned about this nesting template feature from the README.md of this repo.
---
title: |+4
Doc with pre-formatted text
body: |+4
<p>This is normal text.</p>
<pre><code>Now here's some
pre-formatted text
across many lines.</code></pre>
<p>And finally normal text again.</p>
...
EXPECTED:
All five lines of body text to be indented.
This approach could be used to output a valid YAML file with the output content of pandoc variables, some HTML, in a structured and diff-friendly format.
The text was updated successfully, but these errors were encountered:
This actually comes from something in pandoc: the use of the flush combinator for pre tags in T.P.Writers.Blaze (l. 38). flush tells doclayout to ignore the indentation.
This is intentional, because in most cases, indenting a pre tag will cause unwanted spaces in the output.
This YAML context is an exception, but I don't think it would be good to modify the code, because generally we do want pre elements to be flush....
jgm
transferred this issue from jgm/doctemplates
Jan 2, 2023
I'm not blocked by this. I have an alternative approach for my usage scenario. So feel free to close.
My usage scenario is having pandoc output HTML but in a format that stores metadata, title HTML, abstract HTML and body HTML as separate structured data variables. I then have separate code (in Python) doing further processing and eventually injecting these and derived variables into jinja2 templates that are part of building a larger static website.
The way I am currently handling this is having pandoc output "HTML" but into a template that is actually the following XML:
With JSOML I can process the ouput file with the same semantics as JSON and YAML, but the format is diff-friendly like YAML and easier than JSON when looking at strings of large HTML text.
I found this bug using pandoc but I'm guessing it's a bug in this Haskell module.
I learned about this nesting template feature from the README.md of this repo.
STEPS:
With input.md.txt and yaml.template.txt do:
RESULT:
EXPECTED:
All five lines of body text to be indented.
VERSION:
This approach could be used to output a valid YAML file with the output content of pandoc variables, some HTML, in a structured and diff-friendly format.
The text was updated successfully, but these errors were encountered: