Skip to content

Releases: metonym/svelte-highlight

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)

v2.1.0

21 May 22:09
Compare
Choose a tag to compare

Features

  • upgrade highlight.js to v11.0.0-beta1
    • +1 language (wren)
    • +1 style (colors)

v2.0.0-rc.1

30 Apr 21:28
Compare
Choose a tag to compare

Fixes

  • omit .js extension when importing highlight.js language
  • sort types/styles/index.d.ts by name

v2.0.0-rc.0

30 Apr 21:29
Compare
Choose a tag to compare

Breaking Changes

  • upgrade highlight.js to the next major version (v11), which supports ESM
    • removed languages: c-like, htmlbars, sql_more

Features

  • added languages: nestedtext, wasm
  • 143 new styles

v2.0.0

30 Apr 21:28
Compare
Choose a tag to compare

Breaking Changes

  • upgrade highlight.js to the next major version (v11), which supports ESM
    • removed languages: c-like, htmlbars, sql_more

Features

  • added languages: nestedtext, wasm
  • 143 new styles