import { Node } from 'prosemirror-model';
import { isTransparent, toCSSColor } from './ui/toCSSColor.js';
var TextHighlightMarkSpec = {
  attrs: {
    highlightColor: ''
  },
  inline: true,
  group: 'inline',
  parseDOM: [{
    tag: 'span[style*=background-color]',
    getAttrs: function getAttrs(dom) {
      var backgroundColor = dom.style.backgroundColor;
      var color = toCSSColor(backgroundColor);
      return {
        highlightColor: isTransparent(color) ? '' : color
      };
    }
  }],
  toDOM: function toDOM(node) {
    var highlightColor = node.attrs.highlightColor;
    var style = '';
    if (highlightColor) {
      style += "background-color: ".concat(highlightColor, ";");
    }
    return ['span', {
      style: style
    }, 0];
  }
};
export default TextHighlightMarkSpec;
import { bpfrpt_proptype_MarkSpec } from "./Types.js";