"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommonMarkPreset = void 0;
const markdown_1 = require("../extensions/markdown/index.js");
const lodash_1 = require("../lodash.js");
const zero_1 = require("./zero.js");
const CommonMarkPreset = (builder, opts) => {
    builder.use(zero_1.ZeroPreset, opts);
    builder
        .use(markdown_1.Html)
        .use(markdown_1.HorizontalRule)
        .use(markdown_1.Code, opts.code ?? {})
        .use(markdown_1.Bold, opts.bold ?? {})
        .use(markdown_1.Link, opts.link ?? {})
        .use(markdown_1.Lists, opts.lists ?? {})
        .use(markdown_1.Italic, opts.italic ?? {})
        .use(markdown_1.Breaks, opts.breaks ?? {})
        .use(markdown_1.CodeBlock, opts.codeBlock ?? {})
        .use(markdown_1.Blockquote, opts.blockquote ?? {});
    if (opts.image !== false) {
        if ((0, lodash_1.isFunction)(opts.image)) {
            builder.use(opts.image);
        }
        else {
            builder.use(markdown_1.Image, opts.image ?? {});
        }
    }
    if (opts.heading !== false) {
        if ((0, lodash_1.isFunction)(opts.heading))
            builder.use(opts.heading);
        else
            builder.use(markdown_1.Heading, opts.heading ?? {});
    }
};
exports.CommonMarkPreset = CommonMarkPreset;
//# sourceMappingURL=commonmark.js.map
