import subPlugin from 'markdown-it-sub';
import { markTypeFactory } from "../../../../utils/schema.js";
export const subscriptMarkName = 'sub';
export const subscriptType = markTypeFactory(subscriptMarkName);
export const SubscriptSpecs = (builder) => {
    builder
        .configureMd((md) => md.use(subPlugin))
        .addMark(subscriptMarkName, () => ({
        spec: {
            excludes: '_',
            parseDOM: [{ tag: 'sub' }],
            toDOM() {
                return ['sub'];
            },
        },
        toMd: {
            open: (state) => {
                state.escapeWhitespace = true;
                return '~';
            },
            close: (state) => {
                state.escapeWhitespace = false;
                return '~';
            },
            mixable: false,
            expelEnclosingWhitespace: true,
        },
        fromMd: { tokenSpec: { name: subscriptMarkName, type: 'mark' } },
    }));
};
//# sourceMappingURL=index.js.map
