"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const AnchorModifications = require("./AnchorModifications.cjs");
const AnchorElement = require("./AnchorElement.cjs");
const AnchorHtmlDeserializer = require("./AnchorHtmlDeserializer.cjs");
const parseUrl = require("../../../utils/parseUrl.cjs");
const withAnchors = (editor) => {
  const { insertText } = editor;
  editor.registerElement(AnchorElement.anchorElementPlugin);
  editor.htmlDeserializer.registerPlugin(AnchorHtmlDeserializer.anchorHtmlDeserializer);
  editor.insertText = (text) => {
    if (text && parseUrl.parseUrl(text) !== void 0) {
      AnchorModifications.AnchorModifications.wrapAnchor(editor, text);
    } else {
      insertText(text);
    }
  };
  return editor;
};
exports.withAnchors = withAnchors;
//# sourceMappingURL=withAnchors.cjs.map
