UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

28 lines (26 loc) 609 B
import { ALIGNMENT, INDENTATION } from '../groups'; /** * @name indentation_mark */ export const indentation = { excludes: `indentation ${ALIGNMENT}`, group: INDENTATION, attrs: { level: {} }, 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]; } };