"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index = require("../unist-util-visit/lib-index.cjs");
const index$1 = require("../mdast-util-to-string/lib-index.cjs");
const index$2 = require("../unist-util-visit-parents/lib-index.cjs");
function formatHeadingAsSetext(node, state) {
  let literalWithBreak = false;
  index.visit(node, function(node2) {
    if ("value" in node2 && /\r?\n|\r/.test(node2.value) || node2.type === "break") {
      literalWithBreak = true;
      return index$2.EXIT;
    }
  });
  return Boolean(
    (!node.depth || node.depth < 3) && index$1.toString(node) && (state.options.setext || literalWithBreak)
  );
}
exports.formatHeadingAsSetext = formatHeadingAsSetext;
//# sourceMappingURL=lib-util-format-heading-as-setext.cjs.map
