mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 22:14:08 +00:00
Load MathJax config without eval() (#735)
This allows stricter content security policies for `Content-Security-Policy` header.
This commit is contained in:
1 parent
b7c4001ab0
commit
8d8cddfdb2
2 files changed
+9
-8
No files matched your search
@@ -0,0 +1,6 @@
|
||||
window.MathJax = {
|
||||
CommonHTML: { linebreaks: { automatic: true } },
|
||||
tex2jax: { inlineMath: [ ['$', '$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[', '\\]'] ], processEscapes: false },
|
||||
TeX: { noUndefined: { attributes: { mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%' } } },
|
||||
messageStyle: 'none'
|
||||
};
|
||||
@@ -2,14 +2,9 @@
|
||||
|
||||
{{/* Config LaTeX math rendering. */}}
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
CommonHTML: { linebreaks: { automatic: true } },
|
||||
tex2jax: { inlineMath: [ ['$', '$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[', '\\]'] ], processEscapes: false },
|
||||
TeX: { noUndefined: { attributes: { mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%' } } },
|
||||
messageStyle: 'none'
|
||||
});
|
||||
</script>
|
||||
{{ $mathjax_config := resources.Get "js/mathjax-config.js" }}
|
||||
{{ $secureJS := $mathjax_config | resources.Fingerprint "sha512" }}
|
||||
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{/* Attempt to load local vendor JS, otherwise load from CDN. */}}
|
||||
|
||||
Reference in new issue
Block a user