CodeHighlight.svelte view source
accepts children
import CodeHighlight from '@fuzdev/fuz_code/CodeHighlight.svelte'; lang?
type
stringoptional default
'svelte'children?
type
Snippet<[]> & Snippet<[markup: string]>optional
content
The source code to syntax highlight.
type
stringmode?
Highlighting mode: 'auto' uses the CSS Custom Highlight API when
supported and falls back to HTML, 'ranges' forces the Highlight API
(requires browser support), 'html' forces HTML generation with CSS
classes. The Highlight API has limited browser support and requires
theme_highlight.css instead of theme.css.
type HighlightMode
optional default
'auto'inline?
Whether to render as inline code instead of a block.
type
booleanoptional default
falsewrap?
Whether to wrap long lines in block code (white-space: pre-wrap
instead of pre). Wraps at whitespace — long unbroken tokens (URLs,
hashes) still scroll horizontally. Ignored for inline code.
type
booleanoptional default
falsesyntax_styler?
Custom SyntaxStyler instance, e.g. with different languages registered.
type SyntaxStyler
optional default
syntax_styler_globalintersects
SvelteHTMLElements['code']