Releases: rehype-pretty/rehype-pretty-code
Releases · rehype-pretty/rehype-pretty-code
v0.12.1
v0.12.0
🚀 Features
Migrate to Shikiji - by @atomiks and Dimitri POSTOLOV in #109 (b6823)
npm i rehype-pretty-code@latest [email protected] && npm uninstall shiki
- More semantic generated HTML.
[data-rehype-pretty-code-fragment]
is now a<figure>
element ([data-rehype-pretty-code-figure]
), and the title or caption is inside a<figcaption>
element.- Highlighted chars are now wrapped in
<mark>
. - Client-side usage works out of the box, with smaller size.
- Multiple themes now renders a single block and uses CSS variables to change colors.
data-theme
has a space-separated list of the actual theme names, instead of the color mode. - Inline code highlighting can now be escaped.
View changes on GitHub
v0.11.0
🐞 Bug Fixes
Upgrades to unified@11
- chore: remove unused cjs build
- chore: upgrade deps to fix TypeScript build error
View changes on GitHub
v0.10.2
v0.10.1
🚀 Features
- Add default language support - by @GoodbyeNJN in #106 (9a41e)
🐞 Bug Fixes
- Added
display: grid;
incode
element - by @GoodbyeNJN in #105 (d5ca9)
View changes on GitHub
v0.10.0
This release adds better defaults so you don’t need to specify any options or callback hooks.
Breaking Changes
- Default theme is
github-dark-dimmed
, not Shiki’s default ofnord
. .line
class selector has been replaced with[data-line]
.grid: true
option has been added to prevent lines from collapsing by default with code blocks, allowing you to remove theonVisitLine
callback hook.keepBackground
is nowtrue
by default.onVisitHighlightedWord
is nowonVisitHighlightedChars
.
Features
- Highlighted lines now have
data-highlighted-line
attribute by default. - Highlighted chars now have
data-highlighted-chars
attribute by default. - Highlighted chars with id now have
data-chars-id
attribute by default. onVisitTitle
andonVisitCaption
visitor hooks have been added.