diff --git a/package-lock.json b/package-lock.json index 050221d86..75591af86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "13.0.3", + "marked": "14.0.0", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.0", "marked-gfm-heading-id": "^4.0.1", @@ -9840,9 +9840,9 @@ } }, "node_modules/marked": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz", - "integrity": "sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", + "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 59d6c93c2..6fb446dba 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "13.0.3", + "marked": "14.0.0", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.0", "marked-gfm-heading-id": "^4.0.1", diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 878519a4a..bed109772 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -61,7 +61,8 @@ mathParser.functions.signed = function (a) { }; //Processes the markdown within an HTML block if it's just a class-wrapper -renderer.html = function (html) { +renderer.html = function (token) { + let html = token.text; if(_.startsWith(_.trim(html), '')){ const openTag = html.substring(0, html.indexOf('>')+1); html = html.substring(html.indexOf('>')+1); @@ -72,18 +73,21 @@ renderer.html = function (html) { }; // Don't wrap {{ Spans alone on a line, or {{ Divs in

tags -renderer.paragraph = function(text){ +renderer.paragraph = function(token){ let match; + const text = this.parser.parseInline(token.tokens); if(text.startsWith(')$/)) return `${match[1].trim() ? `

${match[1]}

` : ''}