UNPKG

@telefonica/markdown-confluence-sync

Version:

Creates/updates/deletes Confluence pages based on markdown files in a directory. Supports Mermaid diagrams and per-page configuration using frontmatter metadata. Works great with Docusaurus

27 lines (26 loc) 865 B
// SPDX-FileCopyrightText: 2024 Telefónica Innovación Digital // SPDX-License-Identifier: Apache-2.0 import { remove } from "unist-util-remove"; const removedMdxTypes = [ "mdxJsxFlowElement", "mdxTextExpression", "mdxJsxTextElement", "mdxJsxAttribute", "mdxJsxExpressionAttribute", "mdxJsxAttributeValueExpression", "mdxJsEsm", "mdxFlowExpression", ]; /** * UnifiedPlugin to remove mdx code from the AST. * * @see {@link https://github.com/syntax-tree/mdast-util-mdx-expression#syntax-tree} * @see {@link https://github.com/syntax-tree/mdast-util-mdx-jsx#syntax-tree} * @see {@link https://github.com/syntax-tree/mdast-util-mdxjs-esm#syntax-tree} */ const remarkRemoveMdxCode = function remarkRemoveMdxCode() { return function (tree) { remove(tree, removedMdxTypes); }; }; export default remarkRemoveMdxCode;