fix(deps): update expressive-code to ^0.33.0 #477
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.32.4
->^0.33.0
^0.32.4
->^0.33.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
expressive-code/expressive-code (@expressive-code/plugin-collapsible-sections)
v0.33.0
Compare Source
Minor Changes
b7a0607
: AddsmetaOptions
read-only property toExpressiveCodeBlock
instances.This new property contains a parsed version of the code block's
meta
string. This allows plugins to easily access the options specified by users in the opening code fence of a code block, without having to parse themeta
string themselves.All official plugins now use this new API to merge any meta options into the new extensible
ExpressiveCodeBlock.props
property.b7a0607
: Adds newcollapsePreserveIndent
prop to@expressive-code/plugin-collapsible-sections
and replacesstyleOverrides
propertyclosedPadding
withclosedPaddingBlock
.The new prop determines if collapsed section titles (
X collapsed lines
) should be indented to preserve the minimum indent level of their contained collapsed code lines. This allows collapsed sections to integrate better with the surrounding code. Defaults totrue
.Breaking change: If you used the
styleOverrides
propertyclosedPadding
before to change the default padding around closed collapsed section headings, you must now useclosedPaddingBlock
instead. While the old property supported specifying paddings for all four sides, the new property only supports paddings in the block direction (top and bottom in horizontal writing mode). This change was necessary to make collapsed sections compatible with line wrapping and gutter elements.Patch Changes
b7a0607
]b7a0607
]b7a0607
]b7a0607
]b7a0607
]expressive-code/expressive-code (astro-expressive-code)
v0.33.0
Compare Source
Minor Changes
b7a0607
: Adds word wrap support to all Expressive Code blocks.By setting the new
wrap
prop totrue
(either in the opening code fence, as a prop on the<Code>
component, or in thedefaultProps
config option), word wrapping will be enabled, causing lines that exceed the available width to wrap to the next line. The default value offalse
will instead cause a horizontal scrollbar to appear in such cases.The word wrap behavior can be further customized using the new
preserveIndent
prop. Iftrue
(which is the default), wrapped parts of long lines will be aligned with their line's indentation level, making the wrapped code appear to start at the same column. This increases readability of the wrapped code and can be especially useful for languages where indentation is significant, e.g. Python.If you prefer wrapped parts of long lines to always start at column 1, you can set
preserveIndent
tofalse
. This can be useful to reproduce terminal output.b7a0607
: Adds a new gutter API that allows plugins to render gutter elements before code lines.Using the new
addGutterElement
API accessible through the hook context argument, plugins can add gutter elements to a code block. The function expects an object matching the newGutterElement
interface.During rendering, the engine calls the
renderLine
function of the gutter elements registered by all plugins for every line of the code block. The returned elements are then added as children to the line's gutter container.Potentially breaking change: To properly support all combinations of gutter elements and line wrapping, the rendered HTML tree of code blocks had to be changed. The code contents of each line are now wrapped inside an extra
<div class="code">...</div>
element:If gutter elements were added to a code block, an optional
<div class="gutter">...</div>
will be rendered before this new code wrapper:b7a0607
: AddsExpressiveCodeBlock.props
property anddefaultProps
config option.The underlying
ExpressiveCodeBlockProps
interface provides a type-safe way for plugins to extend Expressive Code with their own props using declaration merging. Plugins should use thepreprocessMetadata
hook to merge options specified in the opening code fence into their props, makingprops
the single source of truth for all per-block options.In addition, the new
defaultProps
config option allows you to specify default props that will automatically be set on all fenced code blocks and<Code>
components by the engine. This saves you from having to specify the same props on every block, while still allowing to override them on an individual basis.The
defaultProps
option also supports anoverridesByLang
property, which allows to override the default props for a specific syntax higlighting language.b7a0607
: AddsmetaOptions
read-only property toExpressiveCodeBlock
instances.This new property contains a parsed version of the code block's
meta
string. This allows plugins to easily access the options specified by users in the opening code fence of a code block, without having to parse themeta
string themselves.All official plugins now use this new API to merge any meta options into the new extensible
ExpressiveCodeBlock.props
property.b7a0607
: Migrates syntax highlighting back to Shiki.After the improvements made in Shikiji were merged back into Shiki, Expressive Code now uses Shiki again for syntax highlighting.
Potentially breaking: Although we performed a lot of testing, the migration might cause slightly different highlighting in some cases, as the latest full bundle of Shiki includes various new and updated grammars. We recommend checking if syntax highlighting still looks as expected on your site.
Patch Changes
b7a0607
]b7a0607
]b7a0607
]b7a0607
]b7a0607
]Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.