fix: Incorrect method binding on link serialization

This commit is contained in:
Tom Moor
2023-05-25 18:02:04 -04:00
parent d5341a486c
commit 33b0354cfe

View File

@@ -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) : "") +
")",
};
}