Skip to content

Commit

Permalink
Escape highlighted lines html tags
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez committed Dec 19, 2024
1 parent 4647cea commit 3276e5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Changeset/FileDiff.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import type { Modification } from "@bindings/diff/Modification";
import File from "@app/components/File.svelte";
import { escape } from "lodash";
interface Props {
filePath: string;
Expand Down Expand Up @@ -263,7 +264,7 @@
{@html line.highlight.items
.map(
s =>
`<span class="syntax ${s.style}">${s.item}</span>`,
`<span class="syntax ${s.style}">${escape(s.item)}</span>`,
)
.join("")}
{:else}
Expand Down

0 comments on commit 3276e5f

Please sign in to comment.