From afadfe32d5b2a43940bf5b22e5985b206d4a808b Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 4 Feb 2023 17:03:00 +0800 Subject: [PATCH] Trim --- server/google-analytics.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/google-analytics.js b/server/google-analytics.js index b98ca8623..fc9fbec84 100644 --- a/server/google-analytics.js +++ b/server/google-analytics.js @@ -8,6 +8,11 @@ const jsesc = require("jsesc"); */ function getGoogleAnalyticsScript(tagId) { let escapedTagId = jsesc(tagId, { isScriptContext: true }); + + if (escapedTagId) { + escapedTagId = escapedTagId.trim(); + } + return `