Releases: metonym/svelte-highlight
Releases · metonym/svelte-highlight
v3.4.0
Features
- add
data-language
attribute topre
element to allow targeted styling (b3dbb26, #171 contributed by @willster277) - add
langtag
prop that displays the highlighted language if enabled (b3dbb26, #171 contributed by @willster277)
Set langtag
to true
to display the highlighted language.
<script>
import { HighlightAuto } from "svelte-highlight";
$: code = `.body { padding: 0; margin: 0; }`;
</script>
<HighlightAuto {code} langtag="{true}" />
Style the language tag by targeting the data-language
attribute:
pre.hljs[data-language="css"] {
--hljs-background: linear-gradient(135deg, #2996cf, 80%, white);
--hljs-foreground: #fff;
--hljs-radius: 8px;
}
v3.3.0
v3.2.1
v3.2.0
v3.1.0
v3.0.0
v2.1.0
v2.0.0-rc.1
Fixes
- omit
.js
extension when importinghighlight.js
language - sort
types/styles/index.d.ts
by name
v2.0.0-rc.0
Breaking Changes
- upgrade
highlight.js
to the next major version (v11), which supports ESM- removed languages:
c-like
,htmlbars
,sql_more
- removed languages:
Features
- added languages:
nestedtext
,wasm
- 143 new styles