diff options
Diffstat (limited to 'packages/markdown/remark/src')
-rw-r--r-- | packages/markdown/remark/src/rehype-islands.ts | 6 | ||||
-rw-r--r-- | packages/markdown/remark/src/remark-unwrap.ts | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/packages/markdown/remark/src/rehype-islands.ts b/packages/markdown/remark/src/rehype-islands.ts index b98419cd4..e3fa09860 100644 --- a/packages/markdown/remark/src/rehype-islands.ts +++ b/packages/markdown/remark/src/rehype-islands.ts @@ -1,4 +1,8 @@ -import { SKIP, visit } from 'unist-util-visit'; +import { SKIP, visit as _visit } from 'unist-util-visit'; + +// This is a workaround. +// It fixes a compatibility issue between different, incompatible ASTs given by plugins to Unist +const visit = _visit as (node: any, type: string, callback?: (node: any, index: number, parent: any) => any) => any; // This fixes some confusing bugs coming from somewhere inside of our Markdown pipeline. // `unist`/`remark`/`rehype` (not sure) often generate malformed HTML inside of <astro-root> diff --git a/packages/markdown/remark/src/remark-unwrap.ts b/packages/markdown/remark/src/remark-unwrap.ts index d6f3275ab..15ddb7779 100644 --- a/packages/markdown/remark/src/remark-unwrap.ts +++ b/packages/markdown/remark/src/remark-unwrap.ts @@ -1,4 +1,8 @@ -import { visit, SKIP } from 'unist-util-visit'; +import { visit as _visit, SKIP } from 'unist-util-visit'; + +// This is a workaround. +// It fixes a compatibility issue between different, incompatible ASTs given by plugins to Unist +const visit = _visit as (node: any, type: string, callback?: (node: any, index: number, parent: any) => any) => any; // Remove the wrapping paragraph for <astro-root> islands export default function remarkUnwrap() { |