ChunkedHTML writer: Fix regression including mathjax script.

The fix for #8620 caused the mathjax script to be included
when the table of contents but not the body text of a page
contains math.  But it broke the case where the table of
contents doesn't contain math but the page does.
This patch fixes the issue.

Closes #8967.
This commit is contained in:
John MacFarlane
2023-07-25 08:36:31 -06:00
parent 5b493c2733
commit c06b9ab331
+1 -1
View File
@@ -94,7 +94,7 @@ writeChunkedHTML opts (Pandoc meta blocks) = do
Left e -> throwError $ PandocTemplateError (T.pack e)
Right t -> return t
tocMathVariable <- writeHtml5String opts{ writerTemplate = Just mathVar }
(Pandoc nullMeta [tree])
(Pandoc meta (tree:blocks))
let opts' = opts{ writerVariables =
defField "table-of-contents" renderedTOC
. defField "math" tocMathVariable