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 18, 2024
1 parent 31ad19e commit d3a8f27
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 d3a8f27

Please sign in to comment.