fix(been): replace L.Util.escape with inline escHtml, add og description
This commit is contained in:
@@ -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: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
attribution: '© <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, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||||
|
}
|
||||||
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>'
|
||||||
|
|||||||
Reference in New Issue
Block a user