aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextSchema.tsx
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-06-19 10:07:45 -0400
committerab <abdullah_ahmed@brown.edu>2019-06-19 10:07:45 -0400
commit5959f37c89db0fcafdc2aa94a4aba692960edb54 (patch)
tree720b7010d2d107770862353a5a6ac0e327eb1c8b /src/client/util/RichTextSchema.tsx
parentc2da1676379817fb977a7233fadfb96ab67dc16f (diff)
parent0674331f3611d297028526c888c718a75b012e0a (diff)
merged
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r--src/client/util/RichTextSchema.tsx28
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'
}];
}
},