mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
d3d99fba26
* fix: code component was missing support for meta string Fixed #11604 * Create odd-buttons-pay.md * <Code>: add reference link for meta prop * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/odd-buttons-pay.md * Update .changeset/odd-buttons-pay.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
659 B
659 B
astro |
---|
minor |
Adds a new property meta
to Astro's built-in <Code />
component.
This allows you to provide a value for Shiki's meta
attribute to pass options to transformers.
The following example passes an option to highlight lines 1 and 3 to Shiki's tranformerMetaHighlight
:
---
// src/components/Card.astro
import { Code } from "astro:components";
import { transformerMetaHighlight } from '@shikijs/transformers';
---
<Code
code={code}
lang="js"
transformers={[transformerMetaHighlight()]}
meta="{1,3}" />