1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00

Escape icon title for object key (#2710)

This commit is contained in:
Eric Cornelissen 2020-03-02 12:49:56 +02:00 committed by GitHub
parent 6adef65a54
commit 412ccc0a6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,8 @@ function escape(value) {
return value.replace(/'/g, "\\'");
}
function iconToKeyValue(icon) {
return `'${icon.title}':${iconToObject(icon)}`;
const iconTitle = escape(icon.title);
return `'${iconTitle}':${iconToObject(icon)}`;
}
function iconToObject(icon) {
return util.format(iconObjectTemplate,