From ed11610dbe52c11cd131d080aa89b86e10f2cdb7 Mon Sep 17 00:00:00 2001 From: Damitha Gunawardena Date: Wed, 10 Dec 2025 22:35:33 +1100 Subject: [PATCH 1/2] fix: prevent double-prefix in docsUrl by handling absolute URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure that documentation links use the base docs_url only for relative paths. Absolute URLs are now passed through unchanged, avoiding malformed URLs like: https://lottie.github.io/lottie-spec/latest/https://… --- src/pages/validator.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/validator.js b/src/pages/validator.js index 2e8a3eb..f562bac 100644 --- a/src/pages/validator.js +++ b/src/pages/validator.js @@ -151,9 +151,8 @@ const ValidatorPage = () => { return errors.map((err, index) => { const { path, path_names, type, message, name, docs } = err - const docsUrl = docs - ? `https://lottie.github.io/lottie-spec/latest/${docs}` - : "" + const BASE = "https://lottie.github.io/lottie-spec/latest"; + const docsUrl = docs ? (docs.startsWith("http") ? docs : `${BASE}/${docs}`) : ""; const trClass = type === "warning" From 82a79b9c8bd7028dda5742f6c267eee48d87cbba Mon Sep 17 00:00:00 2001 From: Damitha Gunawardena Date: Thu, 11 Dec 2025 00:30:25 +1100 Subject: [PATCH 2/2] override the validator default_config docs_url --- src/pages/validator.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/validator.js b/src/pages/validator.js index f562bac..4bbca62 100644 --- a/src/pages/validator.js +++ b/src/pages/validator.js @@ -151,8 +151,9 @@ const ValidatorPage = () => { return errors.map((err, index) => { const { path, path_names, type, message, name, docs } = err - const BASE = "https://lottie.github.io/lottie-spec/latest"; - const docsUrl = docs ? (docs.startsWith("http") ? docs : `${BASE}/${docs}`) : ""; + const docsUrl = docs + ? `https://lottie.github.io/lottie-spec/latest/${docs}` + : "" const trClass = type === "warning" @@ -187,7 +188,9 @@ const ValidatorPage = () => { useEffect(() => { setLoading(true) - setValidator(new LottieValidator(Ajv.Ajv2020, lottieSchema)) + setValidator( + new LottieValidator(Ajv.Ajv2020, lottieSchema, { docs_url: "" }) + ) setLoading(false) return () => {