* Create simple react element if element has no children
* Fix for when element has text
* add changeset
* Add additionalProps to Code component and ShikiHighlighter.highlight()
* Add changeset
* Create simple react element if element has no children
* Fix for when element has text
* add changeset
* Add additionalProps to Code component and ShikiHighlighter.highlight()
* Add changeset
* reverted accidental changes
* remove unnecessary parts
* Add HTMLAttributes type to additionalProps
* Update .changeset/calm-bags-deliver.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* extend HTMLAtts instead
* add suggestions
* feat: address reviews
* chore: remove empty line
* feat: move attributes to options
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* 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>
* Fix: Fix a bug that Japanese files were not displayed correctly.
* chore: generate change description
* Update .changeset/cool-colts-watch.md
* add test case for non-UTF-8 file name
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* pass hProperties to getImage for optimized imgs
* fix to allow multiple images to have hProps added
* update test to reflect new expected result
* add comment back in
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* add srcset
* works on multiple images
* fix tests, fix images.ts type and remove console logs
* add warning back to images.ts again lol
* update changeset to be user oriented
* Update calm-socks-shake.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* pass alt through getImage
* added fixture and test
* update lockfile
* fix lockfile again (had installed an extra package during testing and had sharp33 installed)
* update test to reflect passing alt through getImage
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Upgrade shiki
* Update themes
* Update languages
* Simplify
* Fix compat for other remark code
* Update theme again
* Fix language gen
* Add changeset
* Fix code
* Update test theme colors
* Update changeset
* Fix test again