svelte-prism-action 1.1.0 → 1.1.2
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/README.md +8 -0
- package/package.json +1 -1
- package/src/actions/svelte-prism-action.js +4 -2
package/README.md
CHANGED
|
@@ -83,6 +83,14 @@ You can also change the IntersectionObserver options. For more information on wh
|
|
|
83
83
|
|
|
84
84
|
## Changelog
|
|
85
85
|
|
|
86
|
+
### 1.1.2 (2023-03-16)
|
|
87
|
+
|
|
88
|
+
- Fix: highlight fails when `prism-markup.js` import not finished
|
|
89
|
+
|
|
90
|
+
### 1.1.1 (2023-03-15)
|
|
91
|
+
|
|
92
|
+
- Fix: SvelteKit error while loading prism-markup.js
|
|
93
|
+
|
|
86
94
|
### 1.1.0 (2023-03-15)
|
|
87
95
|
|
|
88
96
|
- Add: support for third party language files
|
package/package.json
CHANGED
|
@@ -6,7 +6,6 @@ if (typeof window !== "undefined") {
|
|
|
6
6
|
|
|
7
7
|
import { tick } from "svelte";
|
|
8
8
|
import Prism from "prismjs/components/prism-core";
|
|
9
|
-
import "prismjs/components/prism-markup";
|
|
10
9
|
import getLoader from "prismjs/dependencies";
|
|
11
10
|
import { components } from "./components";
|
|
12
11
|
|
|
@@ -140,7 +139,10 @@ export function prism(node, params) {
|
|
|
140
139
|
//wait for onMount on parent
|
|
141
140
|
let observer;
|
|
142
141
|
|
|
143
|
-
tick().then(() => {
|
|
142
|
+
tick().then(async () => {
|
|
143
|
+
//load markup component, is needed for all languages
|
|
144
|
+
await import(/* @vite-ignore */ "prismjs/components/prism-markup");
|
|
145
|
+
|
|
144
146
|
//add observer to code blocks
|
|
145
147
|
const codeblocks = node.querySelectorAll("code");
|
|
146
148
|
observer = new IntersectionObserver(onIntersect, { ...options });
|