diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2022-02-16 09:09:21 -0500 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2022-02-16 09:09:21 -0500 |
| commit | 514b8467816a16d1e3388b73c0646e6178b7a17f (patch) | |
| tree | 9b96919cf78c251e235b2b5fcbdfaa116b256b6f | |
| parent | b2582b7b0f49b42b77a54fa20ad5885afb261565 (diff) | |
client/js/markdown: fix processing of inline markdown
| -rw-r--r-- | client/.eslintrc.yml | 1 | ||||
| -rw-r--r-- | client/js/util/markdown.js | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/client/.eslintrc.yml b/client/.eslintrc.yml index 6c28a2f..a9d703f 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 ab31a7f..e71e326 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); |