fix(been): replace L.Util.escape with inline escHtml, add og description
This commit is contained in:
6
been.njk
6
been.njk
@@ -2,6 +2,7 @@
|
||||
layout: layouts/been.njk
|
||||
title: Been
|
||||
permalink: /been/
|
||||
description: All past check-ins captured by this site via Micropub.
|
||||
withSidebar: true
|
||||
leafletMap: true
|
||||
---
|
||||
@@ -39,8 +40,11 @@ leafletMap: true
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
maxZoom: 19
|
||||
}).addTo(map);
|
||||
function escHtml(s) {
|
||||
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
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 popup = safeUrl
|
||||
? '<a href="' + safeUrl + '" target="_blank" rel="noopener">' + safeName + '</a>'
|
||||
|
||||
Reference in New Issue
Block a user