import { Blockquote, Bold, Breaks, Code, CodeBlock, Heading, HorizontalRule, Html, Image, Italic, Link, Lists, } from "../extensions/markdown/index.js";
import { isFunction } from "../lodash.js";
import { ZeroPreset } from "./zero.js";
export const CommonMarkPreset = (builder, opts) => {
    builder.use(ZeroPreset, opts);
    builder
        .use(Html)
        .use(HorizontalRule)
        .use(Code, opts.code ?? {})
        .use(Bold, opts.bold ?? {})
        .use(Link, opts.link ?? {})
        .use(Lists, opts.lists ?? {})
        .use(Italic, opts.italic ?? {})
        .use(Breaks, opts.breaks ?? {})
        .use(CodeBlock, opts.codeBlock ?? {})
        .use(Blockquote, opts.blockquote ?? {});
    if (opts.image !== false) {
        if (isFunction(opts.image)) {
            builder.use(opts.image);
        }
        else {
            builder.use(Image, opts.image ?? {});
        }
    }
    if (opts.heading !== false) {
        if (isFunction(opts.heading))
            builder.use(opts.heading);
        else
            builder.use(Heading, opts.heading ?? {});
    }
};
//# sourceMappingURL=commonmark.js.map
