Catch URLs that uses U+2013 that breaks Graphite (#2943)

This commit is contained in:
Peter Hedenskog 2020-03-26 19:44:09 +01:00 committed by GitHub
parent d049ce87ae
commit afccd8225f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -8,7 +8,8 @@ function joinNonEmpty(strings, delimeter) {
}
function toSafeKey(key) {
return key.replace(/[.~ /+|,:?&%)(]|%7C/g, '_');
// U+2013 : EN DASH as used on https://en.wikipedia.org/wiki/201920_coronavirus_pandemic
return key.replace(/[.~ /+|,:?&%)(]|%7C/g, '_');
}
module.exports = {

View File

@ -5,7 +5,7 @@ const flatten = require('./flattenMessage');
module.exports = {
toSafeKey(key, safeChar = '_') {
return key.replace(/[.~ /+|,:?&%]|%7C/g, safeChar);
return key.replace(/[.~ /+|,:?&%]|%7C/g, safeChar);
},
getConnectivity(options) {
// if we have a friendly name for your connectivity, use that!