fix: Code comment and comment marker classes clash

This commit is contained in:
Tom Moor
2023-03-05 17:53:53 -05:00
parent b795c992fe
commit f9709897fe
2 changed files with 5 additions and 5 deletions

View File

@@ -21,10 +21,10 @@ export default class Comment extends Mark {
userId: {},
},
inclusive: false,
parseDOM: [{ tag: "span.comment" }],
parseDOM: [{ tag: "span.comment-marker" }],
toDOM: (node) => [
"span",
{ class: "comment", id: `comment-${node.attrs.id}` },
{ class: "comment-marker", id: `comment-${node.attrs.id}` },
],
};
}
@@ -88,7 +88,7 @@ export default class Comment extends Mark {
mousedown: (view, event: MouseEvent) => {
if (
!(event.target instanceof HTMLSpanElement) ||
!event.target.classList.contains("comment")
!event.target.classList.contains("comment-marker")
) {
return false;
}