Skip to content

reStructuredText metadata is wrapped in <p> #7766

Closed
@not-my-profile

Description

@not-my-profile

Explain the problem.

$ echo '$foo$' > /tmp/foo.html
$ printf '---\nfoo: bar\n---' | pandoc -f markdown --template=/tmp/foo.html
bar
$ printf '=\nA\n=\n:foo: bar' | pandoc -f rst --template=/tmp/foo.html
<p>bar</p>

With RST the metadata value is wrapped in a <p> tag meaning variables cannot be interpolated into attribute values.

(It's worth noting that docutils also does some paragraph normalization).

On a related note it would be nice if lists were preserved as well:

$ printf '$for(foo)$xx $foo$ xx\n$endfor$' > /tmp/foo.html
$ printf '---\nfoo: [bar, baz]\n---' | pandoc -f markdown --template=/tmp/foo.html
xx bar xx
xx baz xx
$ printf '=\nA\n=\n:foo: - bar\n - buz' | pandoc -f rst --template=/tmp/foo.html
xx <ul>
<li>bar</li>
<li>buz</li>
</ul> xx

Pandoc version?
pandoc 2.16.2 on Linux

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions