Fix emoji handling (again)

pull/188/head
Dave Conway-Jones 3 years ago
parent 4d2652c996
commit 7d7b2e2e6e
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "2.21.5",
"version": "2.21.6",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"@turf/bezier-spline": "~6.5.0",

@ -1783,8 +1783,9 @@ function setMarker(data) {
opts.size = opts.size || sz;
opts.size = opts.size * (opts.scale || 1);
// escape out any isocodes eg flag symbols
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed"];
const regex = /\p{Extended_Pictographic}/ug;
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed","country"];
//const regex = /\p{Extended_Pictographic}/ug;
const regex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;
optfields.forEach(function (item) {
if (opts.hasOwnProperty(item) && regex.test(opts[item])) {
opts[item] = unescape(encodeURIComponent(opts[item]));

Loading…
Cancel
Save