svelte-prism-action 1.1.1 → 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 CHANGED
@@ -83,6 +83,10 @@ 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
+
86
90
  ### 1.1.1 (2023-03-15)
87
91
 
88
92
  - Fix: SvelteKit error while loading prism-markup.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-prism-action",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Svelte action for lazy render code blocks with prism.js.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -136,13 +136,13 @@ export function prism(node, params) {
136
136
  });
137
137
  }
138
138
 
139
- //load markup component, is needed for all languages
140
- import(/* @vite-ignore */ "prismjs/components/prism-markup");
141
-
142
139
  //wait for onMount on parent
143
140
  let observer;
144
141
 
145
- 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
+
146
146
  //add observer to code blocks
147
147
  const codeblocks = node.querySelectorAll("code");
148
148
  observer = new IntersectionObserver(onIntersect, { ...options });