Fix emoji handling (again)

This commit is contained in:
Dave Conway-Jones 2021-11-19 11:19:44 +00:00
parent 4d2652c996
commit 7d7b2e2e6e
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "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.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"@turf/bezier-spline": "~6.5.0", "@turf/bezier-spline": "~6.5.0",

View File

@ -1783,8 +1783,9 @@ function setMarker(data) {
opts.size = opts.size || sz; opts.size = opts.size || sz;
opts.size = opts.size * (opts.scale || 1); opts.size = opts.size * (opts.scale || 1);
// escape out any isocodes eg flag symbols // escape out any isocodes eg flag symbols
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed"]; var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed","country"];
const regex = /\p{Extended_Pictographic}/ug; //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) { optfields.forEach(function (item) {
if (opts.hasOwnProperty(item) && regex.test(opts[item])) { if (opts.hasOwnProperty(item) && regex.test(opts[item])) {
opts[item] = unescape(encodeURIComponent(opts[item])); opts[item] = unescape(encodeURIComponent(opts[item]));