Browse Source

Fixed versioning issue with newer version of pandoc.

dockerScript
jrtechs 4 years ago
parent
commit
1b2faeee5e
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      blog/renderBlogPost.js

+ 11
- 6
blog/renderBlogPost.js View File

@ -4,7 +4,7 @@ const utils = require('../utils/utils.js');
const sql = require('../utils/sql');
const argsFull = '--from markdown-markdown_in_html_blocks+raw_html --base-header-level=1 --toc --toc-depth=3 -N --mathjax -t html5';
const argsFull = '--from markdown-markdown_in_html_blocks+raw_html --toc --toc-depth=3 -N --mathjax -t html5';
const argsPreview = '--mathjax -t html5';
@ -198,14 +198,19 @@ module.exports=
reject(err);
}
html = html.split("<img").join("<img style=\"max-width: 100%;\" ");
html = html.split("<code>").join("<code class='hljs cpp'>");
resolve(html);
if(html === undefined)
{
resolve("");
}
else
{
html = html.split("<img").join("<img style=\"max-width: 100%;\" ");
html = html.split("<code>").join("<code class='hljs cpp'>");
resolve(html);
}
};
pandoc(markdownContents, pandocArgs, callback);
});
},

Loading…
Cancel
Save