Skip to content

Commit

Permalink
hex preview: proper html escape bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke authored and maringuu committed Jul 8, 2024
1 parent 636a4ee commit 95a5636
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/web_interface/components/hex_highlighting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import html
import string

from more_itertools import chunked
Expand Down Expand Up @@ -45,7 +46,7 @@ def _get_hex_and_str_preview(line: list[int]) -> tuple[str, str]:
hex_content += span
str_preview += span
hex_content += f' {_chr_to_hex(char)}'
str_preview += f'{chr(char)}' if char in PRINTABLE else '.'
str_preview += html.escape(chr(char)) if char in PRINTABLE else '.'
last_highlighting_class = highlighting_class
if last_highlighting_class is not None: # close last span
hex_content += CLOSING_SPAN
Expand Down

0 comments on commit 95a5636

Please sign in to comment.