Fix for SVG sanitizing (#11742) (#11744)

- Clear our non-breaking-space characters
- These can break SVG rendering in the browser
- Ref: https://github.com/inventree/InvenTree/pull/11655

(cherry picked from commit cead09bcd8)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2026-04-14 12:55:11 +10:00 committed by GitHub
parent d1354fc147
commit 913fe854c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -345,4 +345,8 @@ def sanitize_svg(
link_rel=None,
)
# Replace non-breaking spaces with regular spaces to prevent SVG rendering issues
for nbsp in ['&nbsp;', '&#160;']:
cleaned = cleaned.replace(nbsp, ' ')
return cleaned