diff --git a/.gitignore b/.gitignore index fcedd6d4f..1bc63c97f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ config/local.* todo.md startDB.bat startMViewer.bat +*.xlsx diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 0dd97978c..266230d5b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -1,6 +1,7 @@ const _ = require('lodash'); const Markdown = require('marked'); const renderer = new Markdown.Renderer(); +const lexer = new Markdown.Lexer(); //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (html) { @@ -15,12 +16,6 @@ renderer.html = function (html) { return `${openTag} ${Markdown(html)} ${closeTag}`; } -// Below may work better if we just explicitly allow ')+1); @@ -30,31 +25,17 @@ renderer.html = function (html) { } } - /*if(html.includes('\n')){ - //let openTag = html.substring(0, html.indexOf('\n')); - let openTag = html.substring(0, html.indexOf('>')+1); - console.log("FULL HTML"); - console.log(html); - console.log("OPEN TAG"); - console.log(openTag); - - let closeTag = ''; - if(_.endsWith(_.trim(html), '>')){ - closeTag = html.substring(html.lastIndexOf('<')); - console.log("CLOSETAG"); - console.log(closeTag); - } - else { - let remainder = html.substring(html.indexOf('>')+1); - console.log("REMAINDER"); - console.log(remainder); - return `${openTag} ${Markdown(remainder)}`; - } - }*/ + // Above may work better if we just explicitly allow \n'; @@ -80,7 +61,8 @@ module.exports = { render : (rawBrewText)=>{ return Markdown( sanatizeScriptTags(rawBrewText), - { renderer: renderer } + { renderer: renderer, + lexer: lexer } ); },