import { BlockquoteSpecs, BoldSpecs, BreaksSpecs, CodeBlockSpecs, CodeSpecs, HeadingSpecs, HorizontalRuleSpecs, Html, ImageSpecs, ItalicSpecs, LinkSpecs, ListsSpecs, } from "../extensions/markdown/specs.js";
import { isFunction } from "../lodash.js";
import { ZeroSpecsPreset } from "./zero-specs.js";
export const CommonMarkSpecsPreset = (builder, opts) => {
    builder.use(ZeroSpecsPreset, opts);
    builder
        .use(Html)
        .use(BoldSpecs)
        .use(ItalicSpecs)
        .use(CodeSpecs)
        .use(LinkSpecs)
        .use(ListsSpecs)
        .use(BlockquoteSpecs)
        .use(HorizontalRuleSpecs)
        .use(BreaksSpecs, opts.breaks ?? {})
        .use(CodeBlockSpecs, opts.codeBlock ?? {});
    if (opts.image !== false) {
        builder.use(isFunction(opts.image) ? opts.image : ImageSpecs);
    }
    if (opts.heading !== false) {
        if (isFunction(opts.heading))
            builder.use(opts.heading);
        else
            builder.use(HeadingSpecs, opts.heading ?? {});
    }
};
//# sourceMappingURL=commonmark-specs.js.map
