Skip to content

Commit d3e3a01

Browse files
committed
fix execution stats modal syntax highlighting
1 parent 600f044 commit d3e3a01

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

exampleVault/Test.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ text: this is some text
33
number: 12234234
44
---
55

6+
```js
7+
let a = "*test*";
8+
return a;
9+
```
10+
611
Some text
712
```js-engine
813
let a = "*test*";

jsEngine/engine/ExecutionStatsComponent.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
export let execution: JsExecution;
66
let messages = execution.getMessages();
7+
let prism = window.Prism;
8+
$: highlightCode = prism.highlight(execution.code, prism.languages.javascript, 'javascript');
79
</script>
810

911
<div>
@@ -12,7 +14,7 @@
1214
<p>Execution ID: {execution.uuid}</p>
1315

1416
<h3>Code</h3>
15-
<pre class="language-none"><code>{execution.code}</code></pre>
17+
<pre class="language-js"><code class="language-js">{@html highlightCode}</code></pre>
1618

1719
<h3>Time</h3>
1820
<p>Build Time: {Math.round(execution.functionBuildTime ?? 0)} ms</p>

styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,7 @@ If your plugin does not need CSS, delete this file.
110110

111111
.js-engine-execution-stats-modal {
112112
}
113+
114+
.modal:has(> .js-engine-execution-stats-modal) {
115+
width: unset;
116+
}

0 commit comments

Comments
 (0)