solid-highlight
Advanced tools
+5
-2
| import { spread, mergeProps as mergeProps$1, template } from 'solid-js/web'; | ||
| import Prismjs from 'prismjs'; | ||
| import { mergeProps, splitProps, createMemo } from 'solid-js'; | ||
| import { mergeProps, splitProps, createMemo, createEffect, on } from 'solid-js'; | ||
@@ -328,2 +328,5 @@ // src/index.tsx | ||
| }); | ||
| createEffect(on([languageClass, highlightedCode], () => { | ||
| Prismjs.highlightAll(); | ||
| })); | ||
| return (() => { | ||
@@ -333,3 +336,3 @@ var _el$ = _tmpl$(), _el$2 = _el$.firstChild; | ||
| get ["class"]() { | ||
| return `${languageClass()} ${props.class || ""} line-numbers`; | ||
| return `${languageClass()} ${props.class || ""}`; | ||
| }, | ||
@@ -336,0 +339,0 @@ get innerHTML() { |
+8
-1
| // src/index.tsx | ||
| import Prismjs from "prismjs"; | ||
| import { | ||
| createEffect, | ||
| createMemo, | ||
| mergeProps, | ||
| on, | ||
| splitProps | ||
@@ -332,4 +334,9 @@ } from "solid-js"; | ||
| }); | ||
| createEffect( | ||
| on([languageClass, highlightedCode], () => { | ||
| Prismjs.highlightAll(); | ||
| }) | ||
| ); | ||
| return <pre><code | ||
| class={`${languageClass()} ${props.class || ""} line-numbers`} | ||
| class={`${languageClass()} ${props.class || ""}`} | ||
| innerHTML={highlightedCode()} | ||
@@ -336,0 +343,0 @@ {...rest} |
+5
-2
| import { spread, mergeProps as mergeProps$1, template } from 'solid-js/web'; | ||
| import Prismjs from 'prismjs'; | ||
| import { mergeProps, splitProps, createMemo } from 'solid-js'; | ||
| import { mergeProps, splitProps, createMemo, createEffect, on } from 'solid-js'; | ||
@@ -328,2 +328,5 @@ // src/index.tsx | ||
| }); | ||
| createEffect(on([languageClass, highlightedCode], () => { | ||
| Prismjs.highlightAll(); | ||
| })); | ||
| return (() => { | ||
@@ -333,3 +336,3 @@ var _el$ = _tmpl$(), _el$2 = _el$.firstChild; | ||
| get ["class"]() { | ||
| return `${languageClass()} ${props.class || ""} line-numbers`; | ||
| return `${languageClass()} ${props.class || ""}`; | ||
| }, | ||
@@ -336,0 +339,0 @@ get innerHTML() { |
+8
-1
| // src/index.tsx | ||
| import Prismjs from "prismjs"; | ||
| import { | ||
| createEffect, | ||
| createMemo, | ||
| mergeProps, | ||
| on, | ||
| splitProps | ||
@@ -332,4 +334,9 @@ } from "solid-js"; | ||
| }); | ||
| createEffect( | ||
| on([languageClass, highlightedCode], () => { | ||
| Prismjs.highlightAll(); | ||
| }) | ||
| ); | ||
| return <pre><code | ||
| class={`${languageClass()} ${props.class || ""} line-numbers`} | ||
| class={`${languageClass()} ${props.class || ""}`} | ||
| innerHTML={highlightedCode()} | ||
@@ -336,0 +343,0 @@ {...rest} |
+1
-1
| { | ||
| "name": "solid-highlight", | ||
| "version": "0.1.24", | ||
| "version": "0.1.25", | ||
| "description": "Solid component for syntax highlighting, based on react-highlight and highlightjs' vue plugin", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+9
-1
| import Prismjs from "prismjs"; | ||
| import { | ||
| createEffect, | ||
| createMemo, | ||
| mergeProps, | ||
| on, | ||
| splitProps, | ||
@@ -344,6 +346,12 @@ type ComponentProps, | ||
| createEffect( | ||
| on([languageClass, highlightedCode], () => { | ||
| Prismjs.highlightAll(); | ||
| }) | ||
| ); | ||
| return ( | ||
| <pre> | ||
| <code | ||
| class={`${languageClass()} ${props.class || ""} line-numbers`} | ||
| class={`${languageClass()} ${props.class || ""}`} | ||
| innerHTML={highlightedCode()} | ||
@@ -350,0 +358,0 @@ {...rest} |
52299
1.06%2051
1.33%