mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-30 17:48:27 -05:00
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:
@@ -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)
|
||||
# =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user