@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
23 lines (21 loc) • 576 B
JavaScript
import { indentation as indentationFactory } from '../../next-schema/generated/markTypes';
/**
* @name indentation_mark
*/
export const indentation = indentationFactory({
parseDOM: [{
tag: 'div.fabric-editor-indentation-mark',
getAttrs(dom) {
const level = +(dom.getAttribute('data-level') || '0');
return {
level: level > 6 ? 6 : level < 1 ? false : level
};
}
}],
toDOM(mark) {
return ['div', {
class: 'fabric-editor-block-mark fabric-editor-indentation-mark',
'data-level': mark.attrs.level
}, 0];
}
});