Adds a pre-commit hook to sanitize SVGs

Introduces a new pre-commit hook that removes control characters from SVG files.
This ensures that SVG files are clean and don't contain potentially malicious or problematic characters.
This commit is contained in:
Vijay Janapa Reddi
2025-08-15 13:57:07 -04:00
parent 463c3603fb
commit 19800b309e

View File

@@ -184,6 +184,12 @@ repos:
files: ^quarto/contents/.*\.qmd$
description: "Ensure all referenced images exist on disk"
- id: sanitize-svgs
name: "Remove control chars from SVGs"
entry: bash -c 'perl -pi -e '\''s/[\x00-\x08\x0B\x0C\x0E-\x1F]//g'\'' "$@"' --
language: system
files: \.svg$
# =============================================================================
# PHASE 5: SYSTEM & WORKFLOW CHECKS (Final validation)
# =============================================================================