UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

23 lines 652 B
import { LINK, COLOR } from '../groups'; import { isSafeUrl } from '../../renderer/utils'; import { normalizeUrl } from '../../plugins/hyperlink/utils'; export var link = { excludes: COLOR, group: LINK, attrs: { href: {} }, inclusive: false, parseDOM: [ { tag: 'a[href]', getAttrs: function (dom) { var href = dom.getAttribute('href') || ''; return isSafeUrl(href) ? { href: normalizeUrl(href) } : false; } } ], toDOM: function (node) { return ['a', node.attrs]; } }; //# sourceMappingURL=link.js.map