UNPKG

@atlaskit/adf-schema

Version:

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

40 lines (38 loc) 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.strong = void 0; var _groups = require("../groups"); /** * @name strong_mark */ var strongDOM = ['strong']; var strong = { inclusive: true, group: _groups.FONT_STYLE, parseDOM: [{ tag: 'strong' }, // This works around a Google Docs misbehavior where // pasted content will be inexplicably wrapped in `<b>` // tags with a font-weight normal. { tag: 'b', getAttrs: function getAttrs(node) { var element = node; return element.style.fontWeight !== 'normal' && null; } }, { tag: 'span', getAttrs: function getAttrs(node) { var element = node; var fontWeight = element.style.fontWeight; return typeof fontWeight === 'string' && (fontWeight === 'bold' || fontWeight === 'bolder' || /^(bold(er)?|[5-9]\d{2,})$/.test(fontWeight)) && null; } }], toDOM: function toDOM() { return strongDOM; } }; exports.strong = strong;