Skip to content

Commit

Permalink
fix: escape special characters in keys
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Dec 8, 2021
1 parent cbf95e6 commit 10fdedd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/components/modes/treemode/JSONKey.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { SELECTION_TYPE } from '$lib/logic/selection'
import SearchResultHighlighter from './highlight/SearchResultHighlighter.svelte'
import EditableDiv from '../../controls/EditableDiv.svelte'
import { escapeHTML } from '$lib/utils/domUtils.js'
export let path
export let key
Expand Down Expand Up @@ -50,7 +51,7 @@
{#if searchResult}
<SearchResultHighlighter text={key} {searchResult} />
{:else}
{key}
{escapeHTML(key)}
{/if}
</div>
{/if}
Expand Down

0 comments on commit 10fdedd

Please sign in to comment.