From 07b3bfa1f3f123e094e8646c694ed730686d68e5 Mon Sep 17 00:00:00 2001 From: Ping Lin Date: Sun, 3 Aug 2025 23:32:45 +0100 Subject: [PATCH] Improve input sanitization for split-pdf-by-sections --- .../src/main/resources/templates/split-pdf-by-sections.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/core/src/main/resources/templates/split-pdf-by-sections.html b/app/core/src/main/resources/templates/split-pdf-by-sections.html index 548abe217..aac54ee8f 100644 --- a/app/core/src/main/resources/templates/split-pdf-by-sections.html +++ b/app/core/src/main/resources/templates/split-pdf-by-sections.html @@ -79,6 +79,12 @@ // Initial draw updateVisualAid(); + + // Removes all whitespace characters (spaces, tabs, newlines) as the user types + document.getElementById('pageToSplit').addEventListener('input', function () { + this.value = this.value.replace(/\s+/g, '');; + }); +