From 2affacd222c77cf96014cada7ad295862f59644a Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Fri, 3 Apr 2026 15:32:11 +0300 Subject: [PATCH] fix: use safeJS for jsonify output (was string-escaped, not object) Hugo was wrapping jsonify output in quotes, making it a string instead of a JS object. countries.forEach then fails. Co-Authored-By: Claude Opus 4.6 (1M context) --- layouts/shortcodes/law-charts.html | 2 +- layouts/shortcodes/world-map.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/law-charts.html b/layouts/shortcodes/law-charts.html index d9ab691..55c2209 100644 --- a/layouts/shortcodes/law-charts.html +++ b/layouts/shortcodes/law-charts.html @@ -39,7 +39,7 @@ function ifkInitCharts() { if (typeof Chart === 'undefined') { setTimeout(ifkInitCharts, 100); return; } var LANG = "{{ $lang }}"; - var countries = {{ $countries | jsonify }}; + var countries = {{ $countries | jsonify | safeJS }}; var statusLabels = { en: { enforced: 'Enforced', passed: 'Passed', progress: 'In Progress', guidelines: 'Guidelines' }, diff --git a/layouts/shortcodes/world-map.html b/layouts/shortcodes/world-map.html index 96183ee..926969e 100644 --- a/layouts/shortcodes/world-map.html +++ b/layouts/shortcodes/world-map.html @@ -47,7 +47,7 @@ function ifkInitMap() { fr: { enforced: 'En vigueur', passed: 'Adopté', progress: 'En cours', guidelines: 'Directives' } }; - var countries = {{ $countries | jsonify }}; + var countries = {{ $countries | jsonify | safeJS }}; var byIsoNum = {}; countries.forEach(function(c) { byIsoNum[c.isoNum] = c; });