import { EXIT } from "../../../unist-util-visit-parents/lib/index.js";
import { visit } from "../../../unist-util-visit/lib/index.js";
import { toString } from "../../../mdast-util-to-string/lib/index.js";
function formatHeadingAsSetext(e, r) {
	let i = !1;
	return visit(e, function(e) {
		if ("value" in e && /\r?\n|\r/.test(e.value) || e.type === "break") return i = !0, !1;
	}), !!((!e.depth || e.depth < 3) && toString(e) && (r.options.setext || i));
}
export { formatHeadingAsSetext };
