"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const HeadingElement = require("./HeadingElement.cjs");
const EditorPasteUtils = require("../../../baseEditor/EditorPasteUtils.cjs");
const headingHtmlDeserializer = {
  processBlockPaste: ({ element, next, cumulativeTextAttrs }) => {
    const match = element.nodeName.match(/^H(?<level>[1-6])$/);
    if (match !== null) {
      const isNumbered = (element.getAttribute("style")?.match(/mso-list:\w+ level\d+ \w+/) ?? null) !== null;
      const children = isNumbered ? EditorPasteUtils.EditorPasteUtils.wordPasteListItemContent(element.childNodes) : element.childNodes;
      return {
        type: HeadingElement.headingElementType,
        level: parseInt(match.groups.level),
        children: next(children, cumulativeTextAttrs),
        isNumbered
      };
    }
    return null;
  }
};
exports.headingHtmlDeserializer = headingHtmlDeserializer;
//# sourceMappingURL=HeadingHtmlDeserializer.cjs.map
