UNPKG

@atlaskit/adf-schema

Version:

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

45 lines (43 loc) 981 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.code = void 0; var _groups = require("../groups"); /** * @name code_mark */ var code = { excludes: "".concat(_groups.FONT_STYLE, " ").concat(_groups.LINK, " ").concat(_groups.SEARCH_QUERY, " ").concat(_groups.COLOR), inclusive: true, parseDOM: [{ tag: 'span.code', preserveWhitespace: true }, { tag: 'code', preserveWhitespace: true }, { tag: 'tt', preserveWhitespace: true }, { tag: 'span', preserveWhitespace: true, getAttrs: function getAttrs(domNode) { var dom = domNode; if (dom.style.whiteSpace === 'pre') { return {}; } if (dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') >= 0) { return {}; } return false; } }], toDOM: function toDOM() { return ['span', { class: 'code', spellcheck: 'false' }]; } }; exports.code = code;