Skip to content

Commit

Permalink
fix: REPL link on code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Jul 3, 2024
1 parent 7aa5750 commit e993558
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/code-block/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMemo } from 'preact/hooks';
import { Suspense } from 'preact/compat';
import { wrap } from 'comlink';
import { textToBase64 } from '../controllers/repl/query-encode.js';
import { useResource } from '../../lib/use-resource';

let prismWorker;
Expand Down Expand Up @@ -81,7 +82,7 @@ function HighlightedCodeBlock({ code, lang }) {
</Suspense>
</pre>
{repl && (
<a class="repl-link" href={`/repl?code=${encodeURIComponent(source)}`}>
<a class="repl-link" href={`/repl?code=${encodeURIComponent(textToBase64(source))}`}>
Run in REPL
</a>
)}
Expand Down

0 comments on commit e993558

Please sign in to comment.