From 33b0354cfe30293011305de254c0c5cf94bb1f7e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 25 May 2023 18:02:04 -0400 Subject: [PATCH] fix: Incorrect method binding on link serialization --- shared/editor/marks/Link.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/shared/editor/marks/Link.tsx b/shared/editor/marks/Link.tsx index 864d060d2..7d0ac3680 100644 --- a/shared/editor/marks/Link.tsx +++ b/shared/editor/marks/Link.tsx @@ -285,27 +285,24 @@ export default class Link extends Mark { toMarkdown() { return { - open( + open: ( _state: MarkdownSerializerState, mark: ProsemirrorMark, parent: Node, index: number - ) { - return isPlainURL(mark, parent, index, 1) ? "<" : "["; - }, - close( + ) => (isPlainURL(mark, parent, index, 1) ? "<" : "["), + close: ( state: MarkdownSerializerState, mark: ProsemirrorMark, parent: Node, index: number - ) { - return isPlainURL(mark, parent, index, -1) + ) => + isPlainURL(mark, parent, index, -1) ? ">" : "](" + - state.esc(mark.attrs.href) + - (mark.attrs.title ? " " + this.quote(mark.attrs.title) : "") + - ")"; - }, + state.esc(mark.attrs.href) + + (mark.attrs.title ? " " + this.quote(mark.attrs.title) : "") + + ")", }; }