I created a node for inserting tabs:
tab: {
inline: true,
group: "inline",
parseDOM: ???
toDOM() { return ["span", { style: "white-space:pre" }, "\t"] } }
}
which I then use in buildKeymap like this:
function insertTab(state, dispatch) {
dispatch(state.tr.replaceSelectionWith(schema.nodes.tab.create()).scrollIntoView())
return true
}
if (type = schema.nodes.tab) {
bind("Tab", insertTab)
}
This all works quite well.
I need help writing the parseDOM method for the node. How do I parse the tag (span), white-space:pre style and the internal tab character ?
thanks !