Skip to content

Instantly share code, notes, and snippets.

@copperwall
Created December 14, 2016 06:38
Show Gist options
  • Save copperwall/e2c2fa5d860b82a61d65bb49bec6a7a9 to your computer and use it in GitHub Desktop.
Save copperwall/e2c2fa5d860b82a61d65bb49bec6a7a9 to your computer and use it in GitHub Desktop.
const simpleSchema = new Schema({
nodes: {
doc: {content: "paragraph+"},
paragraph: {
content: "inline<_>*",
group: "block",
parseDOM: [{tag: "p"}],
toDOM() { return ["p", 0] }
},
text: {
group: "inline",
toDOM() { return node.text }
}
},
marks: {
bold: {
parseDOM: [{tag: "i"}, {tag: "em"},
{style: "font-style", getAttrs: value => value == "italic" && null}],
toDOM() { return ["em"] }
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment