summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/src/index.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-05-22 13:50:01 -0400
committerGravatar GitHub <noreply@github.com> 2023-05-22 13:50:01 -0400
commitf558a9e2056fc8f2e2d5814e74f199e398159fc4 (patch)
tree2dfbd56e3eeb24718238d0254e330ec53de6173a /packages/integrations/mdx/src/index.ts
parentb41963b775149b802eea9e12c5fe266bb9a02944 (diff)
downloadastro-f558a9e2056fc8f2e2d5814e74f199e398159fc4.tar.gz
astro-f558a9e2056fc8f2e2d5814e74f199e398159fc4.tar.zst
astro-f558a9e2056fc8f2e2d5814e74f199e398159fc4.zip
[Markdoc] Fix global asset bleed (#6758)
* wip: propagatedAssets flag per-component * Propagate in TreeNode * fix: remove unused inject comment * feat: make asset propagation an integration opt-in * fix: remove crawlGraph stopper * wip: logs to understand what's happening * SSR mdoc files in dev * feat: add astroPropagatedAssets flag with vite * chore: remove console logs * chore: cleanup hasContentFlag * fix: set handlePropagation default for legacy integrations * chore: changeset * temp: silence acorn type error * chore: revert pnpm-lock changes * fix: check correct flag * We need to handle propagation on markdown because of layouts * Remove use of renderStyleElement * Fix heading tests * Fix merge conflict * typeof function * Switch the check * Add comment on injection detection regexp --------- Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Diffstat (limited to 'packages/integrations/mdx/src/index.ts')
-rw-r--r--packages/integrations/mdx/src/index.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts
index 2ccf66266..1ef23e1af 100644
--- a/packages/integrations/mdx/src/index.ts
+++ b/packages/integrations/mdx/src/index.ts
@@ -55,6 +55,9 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
new URL('../template/content-module-types.d.ts', import.meta.url),
'utf-8'
),
+ // MDX can import scripts and styles,
+ // so wrap all MDX files with script / style propagation checks
+ handlePropagation: true,
});
const extendMarkdownConfig =