"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommonMarkSpecsPreset = void 0;
const specs_1 = require("../extensions/markdown/specs.js");
const lodash_1 = require("../lodash.js");
const zero_specs_1 = require("./zero-specs.js");
const CommonMarkSpecsPreset = (builder, opts) => {
    builder.use(zero_specs_1.ZeroSpecsPreset, opts);
    builder
        .use(specs_1.Html)
        .use(specs_1.BoldSpecs)
        .use(specs_1.ItalicSpecs)
        .use(specs_1.CodeSpecs)
        .use(specs_1.LinkSpecs)
        .use(specs_1.ListsSpecs)
        .use(specs_1.BlockquoteSpecs)
        .use(specs_1.HorizontalRuleSpecs)
        .use(specs_1.BreaksSpecs, opts.breaks ?? {})
        .use(specs_1.CodeBlockSpecs, opts.codeBlock ?? {});
    if (opts.image !== false) {
        builder.use((0, lodash_1.isFunction)(opts.image) ? opts.image : specs_1.ImageSpecs);
    }
    if (opts.heading !== false) {
        if ((0, lodash_1.isFunction)(opts.heading))
            builder.use(opts.heading);
        else
            builder.use(specs_1.HeadingSpecs, opts.heading ?? {});
    }
};
exports.CommonMarkSpecsPreset = CommonMarkSpecsPreset;
//# sourceMappingURL=commonmark-specs.js.map
