From b3b283a7d06b428d2fd81e74a6d2545b8f0046c4 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:41:37 -0500 Subject: [PATCH] fix: syntaxHighlight regex adding spaces inside time values The number regex /:(\s*)(\d+)/ was matching colons inside time strings like "14:51:26" turning them into "14: 51: 26". Changed to require the space that JSON.stringify always adds after key-value colons (": \d+") so colons inside string values are not affected. Co-Authored-By: Claude Sonnet 4.6 --- app/templates/logs.html | 4 ++-- app/templates/terceros.html | 4 ++-- app/templates/transaccion.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/templates/logs.html b/app/templates/logs.html index 6096dc2..d19d45b 100644 --- a/app/templates/logs.html +++ b/app/templates/logs.html @@ -266,8 +266,8 @@ function syntaxHighlight(obj) { return json .replace(/("(?:[^"\\]|\\.)*")(?=\s*:)/g,'$1') .replace(/:(\s*)("(?:[^"\\]|\\.)*")/g,': $1$2') - .replace(/:(\s*)(\d+(?:\.\d+)?)/g,': $1$2') - .replace(/:(\s*)(null|true|false)/g,': $1$2'); + .replace(/: (\d+(?:\.\d+)?)/g,': $1') + .replace(/: (null|true|false)/g,': $1'); } {% endblock %} diff --git a/app/templates/terceros.html b/app/templates/terceros.html index d85a806..b8ec585 100644 --- a/app/templates/terceros.html +++ b/app/templates/terceros.html @@ -123,8 +123,8 @@ function syntaxHighlight(obj) { json = json.replace(/&/g, '&').replace(//g, '>'); return json.replace(/("(?:[^"\\]|\\.)*")(?=\s*:)/g, '$1') .replace(/:(\s*)("(?:[^"\\]|\\.)*")/g, ': $1$2') - .replace(/:(\s*)(\d+)/g, ': $1$2') - .replace(/:(\s*)(null|true|false)/g, ': $1$2'); + .replace(/: (\d+)/g, ': $1') + .replace(/: (null|true|false)/g, ': $1'); } {% endblock %} diff --git a/app/templates/transaccion.html b/app/templates/transaccion.html index 77eaf50..e2c95da 100644 --- a/app/templates/transaccion.html +++ b/app/templates/transaccion.html @@ -360,8 +360,8 @@ function syntaxHighlight(obj) { return json .replace(/("(?:[^"\\]|\\.)*")(?=\s*:)/g,'$1') .replace(/:(\s*)("(?:[^"\\]|\\.)*")/g,': $1$2') - .replace(/:(\s*)(\d+(?:\.\d+)?)/g,': $1$2') - .replace(/:(\s*)(null|true|false)/g,': $1$2'); + .replace(/: (\d+(?:\.\d+)?)/g,': $1') + .replace(/: (null|true|false)/g,': $1'); } {% endblock %}