svelte-highlight 6.1.0 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [6.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.1) - 2022-06-27
9
+
10
+ **Refactor**
11
+
12
+ - remove unnecessary `language` null check when setting `data-language` attribute
13
+ - reduce `.langtag` CSS specificity
14
+
8
15
  ## [6.1.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.0) - 2022-06-10
9
16
 
10
17
  **Features**
package/Highlight.svelte CHANGED
@@ -25,16 +25,16 @@ $: if (language.name && language.register) {
25
25
  <!-- prettier-ignore -->
26
26
  <pre
27
27
  class:langtag
28
- data-language={(language.name && language.name) || "plaintext"}
28
+ data-language={language.name || "plaintext"}
29
29
  {...$$restProps}><code class="hljs">{#if highlighted !== undefined}{@html highlighted}{:else}{code}{/if}</code></pre>
30
30
  </slot>
31
31
 
32
32
  <style>
33
- pre.langtag {
33
+ .langtag {
34
34
  position: relative;
35
35
  }
36
36
 
37
- pre.langtag::after {
37
+ .langtag::after {
38
38
  content: attr(data-language);
39
39
  position: absolute;
40
40
  top: 0;
@@ -21,16 +21,16 @@ $: if (code) {
21
21
  <!-- prettier-ignore -->
22
22
  <pre
23
23
  class:langtag
24
- data-language={(language && language) || "plaintext"}
24
+ data-language={language || "plaintext"}
25
25
  {...$$restProps}><code class="hljs">{#if highlighted !== undefined}{@html highlighted}{:else}{code}{/if}</code></pre>
26
26
  </slot>
27
27
 
28
28
  <style>
29
- pre.langtag {
29
+ .langtag {
30
30
  position: relative;
31
31
  }
32
32
 
33
- pre.langtag::after {
33
+ .langtag::after {
34
34
  content: attr(data-language);
35
35
  position: absolute;
36
36
  top: 0;
@@ -25,11 +25,11 @@ $: highlighted = hljs.highlightAuto(code).value;
25
25
  </slot>
26
26
 
27
27
  <style>
28
- pre.langtag {
28
+ .langtag {
29
29
  position: relative;
30
30
  }
31
31
 
32
- pre.langtag::after {
32
+ .langtag::after {
33
33
  content: attr(data-language);
34
34
  position: absolute;
35
35
  top: 0;
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  > Syntax highlighting for Svelte using [highlight.js](https://github.com/highlightjs/highlight.js).
7
7
 
8
- Try it in the [Svelte REPL](https://svelte.dev/repl/e9c59b1d029a49e0b89d296ffc33555b).
8
+ Try it in the [StackBlitz](https://stackblitz.com/edit/svelte-highlight?file=src%2Froutes%2Findex.svelte).
9
9
 
10
10
  ## [Documentation](https://svhe.onrender.com)
11
11
 
@@ -137,7 +137,7 @@ This is also compatible with custom languages.
137
137
  See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languages.
138
138
 
139
139
  ```css
140
- pre[data-language="css"] {
140
+ [data-language="css"] {
141
141
  /* custom style rules */
142
142
  }
143
143
  ```
@@ -171,7 +171,7 @@ Defaults:
171
171
  ```
172
172
 
173
173
  ```css
174
- pre[data-language="css"] {
174
+ [data-language="css"] {
175
175
  --hljs-background: linear-gradient(135deg, #2996cf, 80%, white);
176
176
  --hljs-foreground: #fff;
177
177
  --hljs-radius: 8px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-highlight",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "license": "MIT",
5
5
  "description": "Syntax Highlighting for Svelte using highlight.js",
6
6
  "author": "Eric Liu (https://github.com/metonym)",
@@ -13,24 +13,24 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@sveltejs/adapter-static": "1.0.0-next.34",
16
- "@sveltejs/kit": "1.0.0-next.350",
16
+ "@sveltejs/kit": "1.0.0-next.354",
17
17
  "@testing-library/svelte": "^3.1.3",
18
- "@testing-library/user-event": "^14.2.0",
18
+ "@testing-library/user-event": "^14.2.1",
19
19
  "@types/prettier": "^2.6.3",
20
- "carbon-components-svelte": "^0.65.0",
20
+ "carbon-components-svelte": "^0.66.0",
21
21
  "carbon-icons-svelte": "^11.1.0",
22
- "carbon-preprocess-svelte": "^0.9.0",
23
- "jsdom": "^19.0.0",
24
- "prettier": "^2.6.2",
22
+ "carbon-preprocess-svelte": "^0.9.1",
23
+ "jsdom": "^20.0.0",
24
+ "prettier": "^2.7.1",
25
25
  "prettier-plugin-svelte": "^2.7.0",
26
26
  "svelte": "^3.48.0",
27
- "svelte-check": "^2.7.2",
27
+ "svelte-check": "^2.8.0",
28
28
  "svelte-focus-key": "^0.3.2",
29
29
  "svelte-preprocess": "^4.10.7",
30
- "svelte2tsx": "^0.5.10",
30
+ "svelte2tsx": "^0.5.11",
31
31
  "totalist": "^3.0.0",
32
- "typescript": "^4.7.3",
33
- "vitest": "^0.14.1"
32
+ "typescript": "^4.7.4",
33
+ "vitest": "^0.16.0"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",