Browse Source

Fixed issue with wrong CDM used by MathJax. Fixes #13

pull/22/head
jrtechs 6 years ago
parent
commit
149ba3207f
3 changed files with 19 additions and 3 deletions
  1. +0
    -1
      includes/contact.js
  2. +15
    -1
      includes/html/header.html
  3. +4
    -1
      utils/renderBlogPost.js

+ 0
- 1
includes/contact.js View File

@ -185,7 +185,6 @@ module.exports =
*/
main: function(request, result)
{
console.log("fuck me");
result.writeHead(200, {'Content-Type': 'text/html'});
Promise.all([includes.printAdminHeader(),
processContactPage(request),

+ 15
- 1
includes/html/header.html View File

@ -27,7 +27,21 @@
</style>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full" type="text/javascript"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
".MathJax_Display": {
display: "table-cell ! important",
padding: "1em 0 ! important",
width: (MathJax.Hub.Browser.isMSIE && (document.documentMode||0) < 8 ?
"100% ! important" : "1000em ! important")
}
}
});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</head>

+ 4
- 1
utils/renderBlogPost.js View File

@ -90,6 +90,9 @@ module.exports=
result = result.split("<figcaption>").join("<figcaption style=\"visibility: hidden;\">");
//this line prevents older versions of pandoc from including invalid cdm scripts
result = result.split("<script src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full\" type=\"text/javascript\"></script>").join("");
if(blocks == -1)
resolve(result);
@ -100,7 +103,7 @@ module.exports=
html += "<p>" + htmlBlocks[i];
}
html += " <div class=\"\">\n" +
html += " <div style=\"\">\n" +
" <p class='text-center'><button class=\"btn btn-secondary btn-lg " +
"w3-padding-large w3-white w3-border\" onclick=\"location.href='" +
"http://jrtechs.net/" + category[0].url + "/" + post.url +

Loading…
Cancel
Save