@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
29 lines (28 loc) • 512 B
JavaScript
/**
* @name date_node
*/
export var date = {
inline: true,
group: 'inline',
selectable: true,
attrs: {
timestamp: {
default: ''
}
},
parseDOM: [{
tag: 'span[data-node-type="date"]',
getAttrs: function getAttrs(dom) {
return {
timestamp: dom.getAttribute('data-timestamp')
};
}
}],
toDOM: function toDOM(node) {
var attrs = {
'data-node-type': 'date',
'data-timestamp': node.attrs.timestamp
};
return ['span', attrs];
}
};