@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
19 lines (18 loc) • 597 B
JavaScript
// SPDX-FileCopyrightText: 2024 Telefónica Innovación Digital
// SPDX-License-Identifier: Apache-2.0
import { remove } from "unist-util-remove";
function isMdxCodeBlock(node) {
return (node.type === "code" &&
node.lang?.toLowerCase() === "mdx-code-block");
}
/**
* UnifiedPlugin to remove mdx-code-block from the AST.
*
* @see {@link https://github.com/syntax-tree/mdast#code | code}
*/
const remarkRemoveMdxCodeBlocks = function remarkRemoveMdxCodeBlocks() {
return function (tree) {
remove(tree, isMdxCodeBlock);
};
};
export default remarkRemoveMdxCodeBlocks;