fix(presets): add --mathml to markdown and github pandoc args
Problem: pandoc's default HTML math renderer cannot handle most TeX and dumps raw LaTeX source into the output. `--mathjax` and `--katex` are incompatible with `--embed-resources` because pandoc cannot inline dynamically-loaded JavaScript modules and fonts. Solution: add `--mathml` to both `markdown` and `github` preset args. MathML is rendered natively by all modern browsers with no external dependencies, making it the only math option compatible with self-contained HTML output.
This commit is contained in:
parent
d1fd2b2a73
commit
872a8edd71
1 changed files with 2 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ M.markdown = {
|
||||||
ft = 'markdown',
|
ft = 'markdown',
|
||||||
cmd = { 'pandoc' },
|
cmd = { 'pandoc' },
|
||||||
args = function(ctx)
|
args = function(ctx)
|
||||||
return { ctx.file, '-s', '--embed-resources', '-o', ctx.output }
|
return { ctx.file, '-s', '--embed-resources', '--mathml', '-o', ctx.output }
|
||||||
end,
|
end,
|
||||||
output = function(ctx)
|
output = function(ctx)
|
||||||
return (ctx.file:gsub('%.md$', '.html'))
|
return (ctx.file:gsub('%.md$', '.html'))
|
||||||
|
|
@ -250,6 +250,7 @@ M.github = {
|
||||||
ctx.file,
|
ctx.file,
|
||||||
'-s',
|
'-s',
|
||||||
'--embed-resources',
|
'--embed-resources',
|
||||||
|
'--mathml',
|
||||||
'--css',
|
'--css',
|
||||||
'https://cdn.jsdelivr.net/gh/pixelbrackets/gfm-stylesheet@master/dist/gfm.css',
|
'https://cdn.jsdelivr.net/gh/pixelbrackets/gfm-stylesheet@master/dist/gfm.css',
|
||||||
'-o',
|
'-o',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue