"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.skipSectionsPlugin = void 0;
const folding_headings_extension_1 = require("@diplodoc/folding-headings-extension");
const ignoreTokenTypes = [
    folding_headings_extension_1.TokenType.SectionOpen,
    folding_headings_extension_1.TokenType.SectionClose,
    folding_headings_extension_1.TokenType.ContentOpen,
    folding_headings_extension_1.TokenType.ContentClose,
];
/** Filter heading section tokens, which are not needed in prosemirror-document */
const skipSectionsPlugin = (md) => {
    md.core.ruler.push('skip-heading-sections', (state) => {
        state.tokens = state.tokens.filter((token) => !ignoreTokenTypes.includes(token.type));
    });
};
exports.skipSectionsPlugin = skipSectionsPlugin;
//# sourceMappingURL=skip-heading-sections.js.map
