0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/mdx
Remco Haszing a31bbd7ff8
fix(markdown): don’t generate mdast html nodes (#10104)
* fix(markdown): don’t generate mdast html nodes

`html` nodes from mdast are converted to `raw` hast nodes. These nodes
are then not processed by proper rehype plugins. Typically if a remark
plugin generates `html` nodes, this indicates it should have actually
been a rehype plugin.

This changes the remark plugins that generate `html` nodes into rehype
nodes. These were `remarkPrism` and `remarkShiki`.

Closes #9909

* Apply suggestions from code review

* refactor(mdx): move user defined rehype plugins after syntax highlighting

* fix(mdx): fix issue in mdx rehype plugin ordering

* docs: explain why html/raw nodes are avoided in changeset

This also includes some hints on what users could do to upgrade of they
rely on these nodes.

* Fix MDX rehype plugin ordering

* refactor(remark): restore remarkPrism and remarkShiki

They aren’t used anymore, but removing would be a breaking change.

* chore: mark deprecated

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/thirty-beds-smoke.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:53:39 +00:00
..
src fix(markdown): don’t generate mdast html nodes (#10104) 2024-03-08 10:53:39 +00:00
template @astrojs/markdoc (#6209) 2023-03-07 14:05:19 -05:00
test chore: import sorting for test folder and e2e folder (#10190) 2024-02-22 13:58:10 +00:00
CHANGELOG.md [ci] release (#9843) 2024-01-30 15:41:06 +00:00
package.json Update turbo test dependsOn (#10329) 2024-03-05 15:16:55 +00:00
README.md [ci] format 2023-12-21 20:36:15 +00:00
tsconfig.json config: migrate us to moduleResolution: 'node16' (#8519) 2023-09-13 16:49:22 +02:00

@astrojs/mdx 📝

This Astro integration enables the usage of MDX components and allows you to create pages as .mdx files.

Documentation

Read the @astrojs/mdx docs

Support

Contributing

This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:

License

MIT

Copyright (c) 2023present Astro