fix(been): replace L.Util.escape with inline escHtml, add og description

This commit is contained in:
svemagie
2026-03-20 21:50:22 +01:00
parent 92277df060
commit 2469f6fff0
+5 -1
View File
@@ -2,6 +2,7 @@
layout: layouts/been.njk layout: layouts/been.njk
title: Been title: Been
permalink: /been/ permalink: /been/
description: All past check-ins captured by this site via Micropub.
withSidebar: true withSidebar: true
leafletMap: true leafletMap: true
--- ---
@@ -39,8 +40,11 @@ leafletMap: true
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxZoom: 19 maxZoom: 19
}).addTo(map); }).addTo(map);
function escHtml(s) {
return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
var markers = checkinPoints.map(function(p) { var markers = checkinPoints.map(function(p) {
var safeName = L.Util.escape(p.name); var safeName = escHtml(p.name);
var safeUrl = (p.url && p.url.indexOf('https://') === 0) ? p.url : ''; var safeUrl = (p.url && p.url.indexOf('https://') === 0) ? p.url : '';
var popup = safeUrl var popup = safeUrl
? '<a href="' + safeUrl + '" target="_blank" rel="noopener">' + safeName + '</a>' ? '<a href="' + safeUrl + '" target="_blank" rel="noopener">' + safeName + '</a>'