From f44936d2837da45d674dab62c3561e0a1f9cbef8 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 3 Sep 2021 12:29:55 +0200 Subject: [PATCH] Escape '>' at the start of line FIX: Serializing to Markdown now properly escapes '>' characters at the start of the line. Closes https://github.com/ProseMirror/prosemirror-markdown/issues/56 --- src/to_markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/to_markdown.js b/src/to_markdown.js index 8f667bfd..a5a3eddb 100644 --- a/src/to_markdown.js +++ b/src/to_markdown.js @@ -365,7 +365,7 @@ export class MarkdownSerializerState { // have special meaning only at the start of the line. esc(str, startOfLine) { str = str.replace(/[`*\\~\[\]]/g, "\\$&") - if (startOfLine) str = str.replace(/^[:#\-*+]/, "\\$&").replace(/^(\s*\d+)\./, "$1\\.") + if (startOfLine) str = str.replace(/^[:#\-*+>]/, "\\$&").replace(/^(\s*\d+)\./, "$1\\.") return str }