diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-06-19 10:07:45 -0400 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-06-19 10:07:45 -0400 |
commit | 5959f37c89db0fcafdc2aa94a4aba692960edb54 (patch) | |
tree | 720b7010d2d107770862353a5a6ac0e327eb1c8b /src/client/util/RichTextSchema.tsx | |
parent | c2da1676379817fb977a7233fadfb96ab67dc16f (diff) | |
parent | 0674331f3611d297028526c888c718a75b012e0a (diff) |
merged
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index 391a4fa04..60481f1f9 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -140,6 +140,32 @@ export const nodes: { [index: string]: NodeSpec } = { } }, + video: { + inline: true, + attrs: { + src: {}, + width: { default: "100px" }, + alt: { default: null }, + title: { default: null } + }, + group: "inline", + draggable: true, + parseDOM: [{ + tag: "video[src]", getAttrs(dom: any) { + return { + src: dom.getAttribute("src"), + title: dom.getAttribute("title"), + alt: dom.getAttribute("alt"), + width: Math.min(100, Number(dom.getAttribute("width"))), + }; + } + }], + toDOM(node) { + const attrs = { style: `width: ${node.attrs.width}` }; + return ["video", { ...node.attrs, ...attrs }]; + } + }, + // :: NodeSpec A hard line break, represented in the DOM as `<br>`. hard_break: { inline: true, @@ -259,7 +285,7 @@ export const marks: { [index: string]: MarkSpec } = { parseDOM: [{ style: 'background: #d9dbdd' }], toDOM() { return ['span', { - style: 'background: #d9dbdd' + style: 'color: blue' }]; } }, |