We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/aexol-studio/mdtx/blob/main/packages/mdtx-core/src/transformers/markdown.ts In this file and in the nextJS plugin we should have a possibility to insert our own unified plugins.
const processedContent = await unified() .use(remarkParse) .use(remarkDirective) .use(() => { return (tree, file) => { visit(tree, 'containerDirective', (node) => { const data = node.data || (node.data = {}); const hast = h(node.name, node.attributes); data.hName = hast.tagName; data.hProperties = hast.properties; }); visit(tree, 'html', (node) => { if (node.value.includes('src="')) { node.value = node.value.replace( /src\=\".*\.gitbook/, 'src="/.gitbook', ); // tree.children.push({ type: '' }); } }); visit(tree, 'paragraph', (node) => { const image = node.children.find((child) => child.type === 'image'); if (image && image.type === 'image') { const fileName = image.url.replace(/^.*\.gitbook/, '/.gitbook'); image.url = fileName; } }); }; }) .use(remarkRehype, { allowDangerousHtml: true }) .use(rehypeRaw) .use(rehypeHighlight) .use(rehypeStringify) .process(replaceCustomTags);
The text was updated successfully, but these errors were encountered:
We should add a possibility to provide array of unified plugins
Sorry, something went wrong.
AleksanderBondar
No branches or pull requests
https://github.com/aexol-studio/mdtx/blob/main/packages/mdtx-core/src/transformers/markdown.ts
In this file and in the nextJS plugin we should have a possibility to insert our own unified plugins.
The text was updated successfully, but these errors were encountered: