From 514b8467816a16d1e3388b73c0646e6178b7a17f Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Wed, 16 Feb 2022 09:09:21 -0500 Subject: [PATCH] client/js/markdown: fix processing of inline markdown --- client/.eslintrc.yml | 1 - client/js/util/markdown.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/.eslintrc.yml b/client/.eslintrc.yml index 6c28a2fe..a9d703ff 100644 --- a/client/.eslintrc.yml +++ b/client/.eslintrc.yml @@ -10,4 +10,3 @@ ignorePatterns: - build.js parserOptions: ecmaVersion: 11 - sourceType: module diff --git a/client/js/util/markdown.js b/client/js/util/markdown.js index ab31a7f0..e71e3263 100644 --- a/client/js/util/markdown.js +++ b/client/js/util/markdown.js @@ -1,6 +1,6 @@ "use strict"; -import { marked } from "marked"; +const marked = require("marked"); const DOMPurify = require("dompurify"); class BaseMarkdownWrapper { @@ -159,7 +159,7 @@ function formatMarkdown(text) { for (let wrapper of wrappers) { text = wrapper.preprocess(text); } - text = marked(text, options); + text = marked.parse(text, options); wrappers.reverse(); for (let wrapper of wrappers) { text = wrapper.postprocess(text); @@ -185,7 +185,7 @@ function formatInlineMarkdown(text) { for (let wrapper of wrappers) { text = wrapper.preprocess(text); } - text = marked.inlineLexer(text, [], options); + text = marked.parseInline(text, options); wrappers.reverse(); for (let wrapper of wrappers) { text = wrapper.postprocess(text);