diff --git a/package-lock.json b/package-lock.json index 9cb431541..5476b98d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "2.1.3", + "marked": "3.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", "mongoose": "^5.13.7", @@ -5974,14 +5974,14 @@ } }, "node_modules/marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", + "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==", "bin": { "marked": "bin/marked" }, "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/markedLegacy": { @@ -14059,9 +14059,9 @@ } }, "marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", + "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==" }, "markedLegacy": { "version": "npm:marked@0.3.19", diff --git a/package.json b/package.json index 2fa3e481e..2aafba0a8 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "2.1.3", + "marked": "3.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", "mongoose": "^5.13.7", diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index b37dedf81..8f01f0147 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -65,13 +65,13 @@ const mustacheSpans = { raw : raw, // Text to consume from the source text : text, // Additional custom properties tags : tags, - tokens : this.inlineTokens(text) // inlineTokens to process **bold**, *italics*, etc. + tokens : this.lexer.inlineTokens(text) // inlineTokens to process **bold**, *italics*, etc. }; } } }, renderer(token) { - return ``; // parseInline to turn child tokens into HTML } }; @@ -114,13 +114,13 @@ const mustacheDivs = { raw : raw, // Text to consume from the source text : text, // Additional custom properties tags : tags, - tokens : this.inline(this.blockTokens(text)) + tokens : this.lexer.blockTokens(text) }; } } }, renderer(token) { - return `
`; // parseInline to turn child tokens into HTML } }; @@ -149,7 +149,7 @@ const mustacheInjectInline = { }, renderer(token) { token.type = token.originalType; - const text = this.parseInline([token]); + const text = this.parser.parseInline([token]); const openingTag = /(<[^\s<>]+)([^\n<>]*>.*)/s.exec(text); if(openingTag) { return `${openingTag[1]} class="${token.tags}${openingTag[2]}`; @@ -182,7 +182,7 @@ const mustacheInjectBlock = { }, renderer(token) { token.type = token.originalType; - const text = this.parse([token]); + const text = this.parser.parse([token]); const openingTag = /(<[^\s<>]+)([^\n<>]*>.*)/s.exec(text); if(openingTag) { return `${openingTag[1]} class="${token.tags}${openingTag[2]}`; @@ -211,8 +211,8 @@ const definitionLists = { const definitions = []; while (match = regex.exec(src)) { definitions.push({ - dt : this.inlineTokens(match[1].trim()), - dd : this.inlineTokens(match[2].trim()) + dt : this.lexer.inlineTokens(match[1].trim()), + dd : this.lexer.inlineTokens(match[2].trim()) }); endIndex = regex.lastIndex; } @@ -227,8 +227,8 @@ const definitionLists = { renderer(token) { return `