Open UlyssesZh opened 10 months ago
Seems that it is intended that we should use raw blocks.
tableEqns: true
eqnBlockTemplate: '`<table><tr><td>`{=html}$$t$$`</td><td>`{=html}$$i$$`</td></tr></table>`{=html}'
So there's some weirdness in the parser, but the <br/>
s go away if you use the multiline yaml syntax:
---
tableEqns: true
eqnBlockTemplate: |
<table><tr><td>$$t$$</td><td>$$i$$</td></tr></table>
---
$$e^{i\pi} = -1$${#eq:eq}
@eq:eq
nets us
<div id="eq:eq">
<table>
<tr>
<td>
<span
class="math display"><em>e</em><sup><em>i</em><em>π</em></sup> = − 1</span>
</td>
<td>
<span class="math display">(1)</span>
</td>
</tr>
</table>
</div>
<p>eq. 1</p>
Is it a problem with the YAML parser?
Dunno, but AFAICT it's on the pandoc side. If you feed the following Markdown
---
eqnBlockTemplate: <table><tr><td>$$t$$</td><td>$$i$$</td></tr></table>
---
into pandoc -t native -s
, you can see it inserts line breaks after each tag:
Pandoc
Meta
{ unMeta =
fromList
[ ( "eqnBlockTemplate"
, MetaInlines
[ RawInline (Format "html") "<table>"
, LineBreak
, RawInline (Format "html") "<tr>"
, LineBreak
, RawInline (Format "html") "<td>"
, LineBreak
, Math DisplayMath "t"
, LineBreak
, RawInline (Format "html") "</td>"
, LineBreak
, RawInline (Format "html") "<td>"
, LineBreak
, Math DisplayMath "i"
, LineBreak
, RawInline (Format "html") "</td>"
, LineBreak
, RawInline (Format "html") "</tr>"
, LineBreak
, RawInline (Format "html") "</table>"
]
)
]
}
[]
You can also notice it's treating tags as inline, which it doesn't if you use multiline syntax. The <br/>
seems unintentional, but the inline thing seems not.
test.yml:
test.md:
Command:
Output: