mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
1f92d64ea3
* chore: Update engines field * fix(deps): Remove node-fetch * feat(polyfills): Remove node-fetch for undici * feat(webapi): Remove node-fetch from the webapis polyfills for undici * feat(core): Remove node-fetch for undici in Astro core * feat(telemetry): Remove node-fetch for undici * feat(node): Remove node-fetch for undici in node integration * feat(vercel): Remove node-fetch for undici in Vercel integration * chore: update lockfile * chore: update lockfile * chore: changeset * fix(set): Fix set directives not streaming correctly on Node 16 * Try another approach * Debugging * Debug fetch * Use global fetch if there is one * changeset for lit * Remove web-streams-polyfill * Remove web-streams-polyfill license note * Update .changeset/stupid-wolves-explain.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
CHANGELOG.md | ||
package.json | ||
Prism.astro | ||
README.md | ||
tsconfig.json |
@astrojs/prism
Supports Prism highlighting in Astro projects
Component
This package exports a component to support highlighting inside an Astro file. Example:
---
import { Prism } from "@astrojs/prism"
---
<Prism lang="js" code={`const foo = 'bar';`} />
Internal
This package exports a runHighlighterWithAstro
function to highlight while making sure the Astro language is loaded beforehand
import { runHighlighterWithAstro } from '@astrojs/prism';
runHighlighterWithAstro(`
---
const helloAstro = 'Hello, Astro!';
---
<div>{helloAstro}</div>
`, 'astro');