diff options
| author | Kolen Cheung <[email protected]> | 2022-01-13 20:31:32 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-13 20:31:32 -0800 |
| commit | ed2ab2e2b0eada8e4c4728f23adf96d55eba8172 (patch) | |
| tree | 182c66e8ee08dc8cb8ef25a1ce758ed921ac7d35 | |
| parent | 0d1ba3dce33b8d5d30d7cf8febfa8ea3060b5dfd (diff) | |
HTML template: load header-includes before math (#7833)
MathJax expect the config comes before loading the MathJax script.
This change of order allows one to config MathJax via header-includes,
which loads before the MathJax script.
This potentially is a breaking change.
However, the only kind math supported by pandoc that is configurable
seems to be katex, and according to src/Text/Pandoc/Writers/HTML.hs
the way it is configured is hard-coded (katex doesn't seem to offer
MathJax style config that is independent of loading katex.)
So it seems it is safe to change this order without breaking
others' documents.
c.f. #2750
| -rw-r--r-- | data/templates/default.html4 | 6 | ||||
| -rw-r--r-- | data/templates/default.html5 | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/data/templates/default.html4 b/data/templates/default.html4 index 00f0bacbc..daef6adb2 100644 --- a/data/templates/default.html4 +++ b/data/templates/default.html4 @@ -23,12 +23,12 @@ $endif$ $for(css)$ <link rel="stylesheet" href="$css$" type="text/css" /> $endfor$ -$if(math)$ - $math$ -$endif$ $for(header-includes)$ $header-includes$ $endfor$ +$if(math)$ + $math$ +$endif$ </head> <body> $for(include-before)$ diff --git a/data/templates/default.html5 b/data/templates/default.html5 index 5242f797f..dda7e8cb0 100644 --- a/data/templates/default.html5 +++ b/data/templates/default.html5 @@ -23,15 +23,15 @@ $endif$ $for(css)$ <link rel="stylesheet" href="$css$" /> $endfor$ +$for(header-includes)$ + $header-includes$ +$endfor$ $if(math)$ $math$ $endif$ <!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> <![endif]--> -$for(header-includes)$ - $header-includes$ -$endfor$ </head> <body> $for(include-before)$ |
