diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-06 01:42:32 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-06 01:42:32 -0400 |
commit | 760465b0723e2b21a07269afe61a0207a0bc5580 (patch) | |
tree | fcfac8c7495ea95096a22aba401fc99cb6d17a13 /src/client/util/RichTextSchema.tsx | |
parent | e5b52b1083c86b946a2758983e397826579d2282 (diff) | |
parent | 717e32f8f140127a628c5ea4b7543c1703459e15 (diff) |
merged
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index a8ba0a4be..31a65dd3a 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -244,7 +244,8 @@ export const marks: { [index: string]: MarkSpec } = { attrs: { href: {}, location: { default: null }, - title: { default: null } + title: { default: null }, + docref: { default: false } }, inclusive: false, parseDOM: [{ @@ -252,7 +253,11 @@ export const marks: { [index: string]: MarkSpec } = { return { href: dom.getAttribute("href"), location: dom.getAttribute("location"), title: dom.getAttribute("title") }; } }], - toDOM(node: any) { return ["a", node.attrs, 0]; } + toDOM(node: any) { + return node.attrs.docref && node.attrs.title ? + ["div", ["span", `"`], ["span", 0], ["span", `"`], ["br"], ["a", { ...node.attrs, class: "prosemirror-attribution" }, node.attrs.title], ["br"]] : + ["a", { ...node.attrs }, 0]; + } }, // :: MarkSpec An emphasis mark. Rendered as an `<em>` element. |