* fix(mdx): convert remark-images-to-component plugin to a rehype plugin (#10697)
* Remove fs read for MDX transform (#10866)
* Tag MDX component for faster checks when rendering (#10864)
* Use unified plugin only for MDX transform (#10869)
* Only traverse children and handle mdxJsxTextElement when optimizing (#10885)
* Rename to `optimize.ignoreComponentNames` in MDX (#10884)
* Allow remark/rehype plugins added after mdx to work (#10877)
* Improve MDX optimize with sibling nodes (#10887)
* Improve types in rehype-optimize-static.ts
* Rename `ignoreComponentNames` to `ignoreElementNames`
I think this better reflects what it's actually doing
* Simplify plain MDX nodes in optimize option (#10934)
* Format code
* Minimize diff changes
* Update .changeset/slimy-cobras-end.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Armand Philippot <59021693+ArmandPhilippot@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Improve content collection styles and scripts build perf
* Update test
It was actually a bug. There was an empty module script injected.
* Skip test
* Fix test not matching non-ccc behaviour
* Workaround bug to make test pass
* Update .changeset/grumpy-pillows-develop.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* 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>
* chore: use biome to sort imports
* do the sorting
* Update package.json
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* rearrange plugins and add props to Image component
* add tests and update lockfile
* add changeset
* re-rearrange plugin order, gfm/smartypants then user defined then image related then shiki/prism
* make more generic
* add more/better tests
* remove unused logger
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>