Skip to content

Releases: metonym/svelte-highlight

v5.1.1

19 Oct 15:48
Compare
Choose a tag to compare

Fixes

  • emit TypeScript definitions for languages and styles to the src/ folder

v5.1.0

17 Oct 14:30
Compare
Choose a tag to compare

Features

  • upgrade highlight.js to v11.3.0

v5.0.0

08 Oct 23:05
Compare
Choose a tag to compare

Breaking Changes

  • use .svelte.d.ts extension for TypeScript definitions

v4.0.0

16 Sep 19:08
Compare
Choose a tag to compare

Breaking Changes

  • move .hljs class from pre to code (ead430a, #173 contributed by @willster277)
  • change padding of pre.langtag::after to 1em (ead430a, #173 contributed by @willster277)

v3.4.0

12 Sep 22:35
Compare
Choose a tag to compare

Features

  • add data-language attribute to pre 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

01 Sep 16:17
Compare
Choose a tag to compare

Features

  • include named language export in src/languages/* files

    // default export
    import typescript from "svelte-highlight/src/languages/typescript";
    
    // named export
    import { typescript } from "svelte-highlight/src/languages/typescript";

v3.2.1

01 Sep 16:17
Compare
Choose a tag to compare

Documentation

  • update link to live demo

v3.2.0

02 Aug 13:23
Compare
Choose a tag to compare

Features

v3.1.0

08 Jul 15:21
Compare
Choose a tag to compare

Features

v3.0.0

30 May 12:51
Compare
Choose a tag to compare

Breaking Changes

  • github-gist style removed from highlight.js

Features

  • upgrade highlight.js to v11.0.0
    • +2 styles (github-dark, github-dark-dimmed)