Improved name sanitiser regex

This commit is contained in:
Dan Leech 2015-12-10 10:33:15 +00:00
parent 8625aa6daf
commit 0844f984fc
4 changed files with 5 additions and 5 deletions

View File

@ -224,7 +224,7 @@
<li class="tiles__item" data-search="pocket pocket ef3f56" style="background-color:#EF3F56"><a href="https://simpleicons.org/icons/pocket.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M12.533 6.84L8.77 10.45c-.213.204-.486.306-.76.306-.273 0-.547-.102-.76-.306L3.488 6.84c-.437-.418-.45-1.113-.032-1.55.42-.438 1.114-.452 1.55-.033l3.005 2.88 3.005-2.88c.436-.42 1.13-.405 1.55.032.42.437.405 1.13-.032 1.55zm3.388-5.028c-.207-.572-.755-.956-1.363-.956H1.45c-.6 0-1.144.376-1.357.936-.063.166-.095.34-.095.515v4.828l.055.96c.232 2.184 1.365 4.092 3.12 5.423.03.024.063.047.095.07l.02.015c.94.687 1.992 1.152 3.128 1.382.524.105 1.06.16 1.592.16.492 0 .986-.046 1.472-.136.058-.013.116-.023.175-.037.016-.002.033-.01.05-.018 1.088-.237 2.098-.69 3.004-1.352l.02-.014.096-.072c1.754-1.33 2.887-3.24 3.12-5.423l.054-.96V2.307c0-.167-.02-.333-.08-.495z" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Pocket</span><br><span class="hex">#EF3F56</span></li>
<li class="tiles__item" data-search="sina weibo sinaweibo e6162d" style="background-color:#E6162D"><a href="https://simpleicons.org/icons/sinaweibo.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M6.72 13.532c-2.647.26-4.934-.936-5.106-2.675C1.442 9.12 3.45 7.497 6.1 7.235c2.648-.262 4.934.935 5.106 2.674.172 1.738-1.836 3.36-4.485 3.622zm-.697-2.066c-.256.41-.804.588-1.218.4-.407-.186-.527-.66-.27-1.06.252-.396.783-.573 1.193-.4.415.175.547.647.295 1.06zm.845-1.083c-.093.158-.298.234-.458.168-.158-.064-.208-.24-.118-.397.092-.154.29-.23.447-.167.16.058.216.237.128.397zm.118-1.81c-1.26-.328-2.685.3-3.233 1.41-.557 1.134-.018 2.39 1.255 2.802 1.32.426 2.874-.226 3.415-1.45.533-1.194-.133-2.425-1.437-2.762zm5.033-.814c-.226-.068-.38-.114-.263-.41.256-.643.282-1.197.005-1.593-.52-.742-1.94-.702-3.57-.02 0 0-.51.224-.38-.182.25-.805.213-1.48-.177-1.87-.884-.884-3.234.034-5.25 2.05C.876 7.242 0 8.842 0 10.224c0 2.647 3.393 4.255 6.713 4.255 4.35 0 7.246-2.528 7.246-4.535 0-1.213-1.023-1.9-1.94-2.186zm1.275-3.386c-.51-.568-1.266-.783-1.964-.635-.284.06-.465.34-.404.625.06.284.34.467.625.405.342-.072.71.033.962.31.25.278.317.656.21.987-.09.277.062.575.34.665.277.088.574-.063.663-.34.22-.678.083-1.45-.43-2.018zm1.614-1.457c-1.052-1.165-2.602-1.61-4.033-1.304-.33.07-.542.396-.47.727.07.33.395.542.726.47 1.018-.215 2.12.1 2.866.928.746.828.948 1.957.63 2.946-.106.323.07.668.393.772.322.104.667-.072.772-.394V7.06c.448-1.392.165-2.98-.886-4.143z" fill="#fff"/></svg></a><span class="tile-name">Sina Weibo</span><br><span class="hex">#E6162D</span></li>
<li class="tiles__item" data-search="pinterest pinterest bd081c" style="background-color:#BD081C"><a href="https://simpleicons.org/icons/pinterest.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8 0C3.582 0 0 3.582 0 8c0 3.39 2.108 6.285 5.084 7.45-.07-.633-.133-1.604.028-2.295.146-.625.938-3.977.938-3.977s-.24-.48-.24-1.188c0-1.11.646-1.943 1.448-1.943.683 0 1.012.513 1.012 1.127 0 .687-.436 1.713-.662 2.664-.19.797.4 1.445 1.185 1.445 1.42 0 2.514-1.498 2.514-3.662 0-1.915-1.376-3.254-3.342-3.254-2.276 0-3.61 1.707-3.61 3.472 0 .687.263 1.424.593 1.825.066.08.075.15.057.23-.06.252-.196.796-.223.907-.035.146-.115.178-.268.107-.998-.465-1.624-1.926-1.624-3.1 0-2.524 1.834-4.84 5.287-4.84 2.774 0 4.932 1.977 4.932 4.62 0 2.757-1.74 4.977-4.153 4.977-.81 0-1.572-.422-1.833-.92l-.5 1.902c-.18.695-.667 1.566-.994 2.097.75.232 1.545.357 2.37.357 4.417 0 8-3.582 8-8s-3.583-8-8-8z" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Pinterest</span><br><span class="hex">#BD081C</span></li>
<li class="tiles__item" data-search="macys macys e11a2b" style="background-color:#E11A2B"><a href="https://simpleicons.org/icons/macys.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8.01.415l-1.883 5.78H0l4.964 3.59-1.88 5.782L8 11.99l4.948 3.595-1.89-5.808L16 6.194H9.892L8.01.414z" fill="#fff"/></svg></a><span class="tile-name">Macys</span><br><span class="hex">#E11A2B</span></li>
<li class="tiles__item" data-search="macys macys e11a2b" style="background-color:#E11A2B"><a href="https://simpleicons.org/icons/macys.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8.01.415l-1.883 5.78H0l4.964 3.59-1.88 5.782L8 11.99l4.948 3.595-1.89-5.808L16 6.194H9.892L8.01.414z" fill="#fff"/></svg></a><span class="tile-name">Macys</span><br><span class="hex">#E11A2B</span></li>
<li class="tiles__item" data-search="opera opera ff1b2d" style="background-color:#FF1B2D"><a href="https://simpleicons.org/icons/opera.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M5.367 3.492C4.482 4.536 3.91 6.08 3.87 7.812v.376c.04 1.732.612 3.276 1.497 4.32 1.147 1.49 2.853 2.435 4.76 2.435 1.17 0 2.267-.357 3.204-.98C11.917 15.23 10.05 16 8 16c-.128 0-.255-.003-.38-.01C3.377 15.793 0 12.29 0 8c0-4.42 3.582-8 8-8h.03c2.037.008 3.894.777 5.302 2.036-.938-.62-2.034-.98-3.206-.98-1.906 0-3.612.946-4.76 2.436zM16 8c0 2.37-1.03 4.498-2.668 5.963-2.052 1-3.964.3-4.597-.137 2.015-.442 3.538-2.88 3.538-5.826 0-2.948-1.523-5.384-3.538-5.827.632-.436 2.545-1.136 4.597-.137C14.97 3.5 16 5.63 16 8z" fill="#fff"/></svg></a><span class="tile-name">Opera</span><br><span class="hex">#FF1B2D</span></li>
<li class="tiles__item" data-search="netflix netflix e50914" style="background-color:#e50914"><a href="https://simpleicons.org/icons/netflix.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M6.338 15.683V6.86l2.984 8.467c.917-.104 1.836-.2 2.757-.292V0H9.66v9.138L6.442 0H3.92v16h.016c.8-.11 1.6-.216 2.402-.317" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Netflix</span><br><span class="hex">#e50914</span></li>
<li class="tiles__item" data-search="sauce labs saucelabs ec4047" style="background-color:#EC4047"><a href="https://simpleicons.org/icons/saucelabs.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><g fill="#fff" fill-rule="nonzero"><path d="M15.204.002L.782 0 .777 9.18H3.27c2.053.04 1.862 1.434 2.042 2.705.183 1.292 1.418 1.925 2.455 1.925 1.357 0 2.43-1.164 2.43-2.55 0-1.07-.49-1.84-2.6-2.74C5.204 7.51 4.6 6.084 4.6 4.696c0-2.27 1.735-3.79 3.75-3.79 1.057 0 2.208.338 2.988 1.217.63.71.857 1.427.832 2.312-.01.388-.056.885.73.896l2.304.005V.002z"/><path d="M15.223 6.62l-2.174-.008s-2.3.18-2.17-1.584c.06-.85-.19-1.498-.366-1.77-.458-.71-1.223-1.064-2.146-1.064-1.357 0-2.354 1.13-2.354 2.313 0 1.03.5 2.183 2.63 3.008 1.847.713 2.996 1.954 2.996 3.68 0 1.818-1.382 3.94-3.87 3.94-1.28 0-2.44-.305-3.328-1.576-.452-.647-.626-1.48-.656-2.314-.025-.64-.194-.78-.633-.78l-2.37.007V16h14.433V6.7l.007-.08z"/></g></svg></a><span class="tile-name">Sauce Labs</span><br><span class="hex">#EC4047</span></li>

View File

@ -224,7 +224,7 @@
<li class="tiles__item" data-search="pocket pocket ef3f56" style="background-color:#EF3F56"><a href="https://simpleicons.org/icons/pocket.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M12.533 6.84L8.77 10.45c-.213.204-.486.306-.76.306-.273 0-.547-.102-.76-.306L3.488 6.84c-.437-.418-.45-1.113-.032-1.55.42-.438 1.114-.452 1.55-.033l3.005 2.88 3.005-2.88c.436-.42 1.13-.405 1.55.032.42.437.405 1.13-.032 1.55zm3.388-5.028c-.207-.572-.755-.956-1.363-.956H1.45c-.6 0-1.144.376-1.357.936-.063.166-.095.34-.095.515v4.828l.055.96c.232 2.184 1.365 4.092 3.12 5.423.03.024.063.047.095.07l.02.015c.94.687 1.992 1.152 3.128 1.382.524.105 1.06.16 1.592.16.492 0 .986-.046 1.472-.136.058-.013.116-.023.175-.037.016-.002.033-.01.05-.018 1.088-.237 2.098-.69 3.004-1.352l.02-.014.096-.072c1.754-1.33 2.887-3.24 3.12-5.423l.054-.96V2.307c0-.167-.02-.333-.08-.495z" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Pocket</span><br><span class="hex">#EF3F56</span></li>
<li class="tiles__item" data-search="sina weibo sinaweibo e6162d" style="background-color:#E6162D"><a href="https://simpleicons.org/icons/sinaweibo.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M6.72 13.532c-2.647.26-4.934-.936-5.106-2.675C1.442 9.12 3.45 7.497 6.1 7.235c2.648-.262 4.934.935 5.106 2.674.172 1.738-1.836 3.36-4.485 3.622zm-.697-2.066c-.256.41-.804.588-1.218.4-.407-.186-.527-.66-.27-1.06.252-.396.783-.573 1.193-.4.415.175.547.647.295 1.06zm.845-1.083c-.093.158-.298.234-.458.168-.158-.064-.208-.24-.118-.397.092-.154.29-.23.447-.167.16.058.216.237.128.397zm.118-1.81c-1.26-.328-2.685.3-3.233 1.41-.557 1.134-.018 2.39 1.255 2.802 1.32.426 2.874-.226 3.415-1.45.533-1.194-.133-2.425-1.437-2.762zm5.033-.814c-.226-.068-.38-.114-.263-.41.256-.643.282-1.197.005-1.593-.52-.742-1.94-.702-3.57-.02 0 0-.51.224-.38-.182.25-.805.213-1.48-.177-1.87-.884-.884-3.234.034-5.25 2.05C.876 7.242 0 8.842 0 10.224c0 2.647 3.393 4.255 6.713 4.255 4.35 0 7.246-2.528 7.246-4.535 0-1.213-1.023-1.9-1.94-2.186zm1.275-3.386c-.51-.568-1.266-.783-1.964-.635-.284.06-.465.34-.404.625.06.284.34.467.625.405.342-.072.71.033.962.31.25.278.317.656.21.987-.09.277.062.575.34.665.277.088.574-.063.663-.34.22-.678.083-1.45-.43-2.018zm1.614-1.457c-1.052-1.165-2.602-1.61-4.033-1.304-.33.07-.542.396-.47.727.07.33.395.542.726.47 1.018-.215 2.12.1 2.866.928.746.828.948 1.957.63 2.946-.106.323.07.668.393.772.322.104.667-.072.772-.394V7.06c.448-1.392.165-2.98-.886-4.143z" fill="#fff"/></svg></a><span class="tile-name">Sina Weibo</span><br><span class="hex">#E6162D</span></li>
<li class="tiles__item" data-search="pinterest pinterest bd081c" style="background-color:#BD081C"><a href="https://simpleicons.org/icons/pinterest.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8 0C3.582 0 0 3.582 0 8c0 3.39 2.108 6.285 5.084 7.45-.07-.633-.133-1.604.028-2.295.146-.625.938-3.977.938-3.977s-.24-.48-.24-1.188c0-1.11.646-1.943 1.448-1.943.683 0 1.012.513 1.012 1.127 0 .687-.436 1.713-.662 2.664-.19.797.4 1.445 1.185 1.445 1.42 0 2.514-1.498 2.514-3.662 0-1.915-1.376-3.254-3.342-3.254-2.276 0-3.61 1.707-3.61 3.472 0 .687.263 1.424.593 1.825.066.08.075.15.057.23-.06.252-.196.796-.223.907-.035.146-.115.178-.268.107-.998-.465-1.624-1.926-1.624-3.1 0-2.524 1.834-4.84 5.287-4.84 2.774 0 4.932 1.977 4.932 4.62 0 2.757-1.74 4.977-4.153 4.977-.81 0-1.572-.422-1.833-.92l-.5 1.902c-.18.695-.667 1.566-.994 2.097.75.232 1.545.357 2.37.357 4.417 0 8-3.582 8-8s-3.583-8-8-8z" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Pinterest</span><br><span class="hex">#BD081C</span></li>
<li class="tiles__item" data-search="macys macys e11a2b" style="background-color:#E11A2B"><a href="https://simpleicons.org/icons/macys.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8.01.415l-1.883 5.78H0l4.964 3.59-1.88 5.782L8 11.99l4.948 3.595-1.89-5.808L16 6.194H9.892L8.01.414z" fill="#fff"/></svg></a><span class="tile-name">Macys</span><br><span class="hex">#E11A2B</span></li>
<li class="tiles__item" data-search="macys macys e11a2b" style="background-color:#E11A2B"><a href="https://simpleicons.org/icons/macys.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8.01.415l-1.883 5.78H0l4.964 3.59-1.88 5.782L8 11.99l4.948 3.595-1.89-5.808L16 6.194H9.892L8.01.414z" fill="#fff"/></svg></a><span class="tile-name">Macys</span><br><span class="hex">#E11A2B</span></li>
<li class="tiles__item" data-search="opera opera ff1b2d" style="background-color:#FF1B2D"><a href="https://simpleicons.org/icons/opera.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M5.367 3.492C4.482 4.536 3.91 6.08 3.87 7.812v.376c.04 1.732.612 3.276 1.497 4.32 1.147 1.49 2.853 2.435 4.76 2.435 1.17 0 2.267-.357 3.204-.98C11.917 15.23 10.05 16 8 16c-.128 0-.255-.003-.38-.01C3.377 15.793 0 12.29 0 8c0-4.42 3.582-8 8-8h.03c2.037.008 3.894.777 5.302 2.036-.938-.62-2.034-.98-3.206-.98-1.906 0-3.612.946-4.76 2.436zM16 8c0 2.37-1.03 4.498-2.668 5.963-2.052 1-3.964.3-4.597-.137 2.015-.442 3.538-2.88 3.538-5.826 0-2.948-1.523-5.384-3.538-5.827.632-.436 2.545-1.136 4.597-.137C14.97 3.5 16 5.63 16 8z" fill="#fff"/></svg></a><span class="tile-name">Opera</span><br><span class="hex">#FF1B2D</span></li>
<li class="tiles__item" data-search="netflix netflix e50914" style="background-color:#e50914"><a href="https://simpleicons.org/icons/netflix.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M6.338 15.683V6.86l2.984 8.467c.917-.104 1.836-.2 2.757-.292V0H9.66v9.138L6.442 0H3.92v16h.016c.8-.11 1.6-.216 2.402-.317" fill="#fff" fill-rule="nonzero"/></svg></a><span class="tile-name">Netflix</span><br><span class="hex">#e50914</span></li>
<li class="tiles__item" data-search="sauce labs saucelabs ec4047" style="background-color:#EC4047"><a href="https://simpleicons.org/icons/saucelabs.svg"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><g fill="#fff" fill-rule="nonzero"><path d="M15.204.002L.782 0 .777 9.18H3.27c2.053.04 1.862 1.434 2.042 2.705.183 1.292 1.418 1.925 2.455 1.925 1.357 0 2.43-1.164 2.43-2.55 0-1.07-.49-1.84-2.6-2.74C5.204 7.51 4.6 6.084 4.6 4.696c0-2.27 1.735-3.79 3.75-3.79 1.057 0 2.208.338 2.988 1.217.63.71.857 1.427.832 2.312-.01.388-.056.885.73.896l2.304.005V.002z"/><path d="M15.223 6.62l-2.174-.008s-2.3.18-2.17-1.584c.06-.85-.19-1.498-.366-1.77-.458-.71-1.223-1.064-2.146-1.064-1.357 0-2.354 1.13-2.354 2.313 0 1.03.5 2.183 2.63 3.008 1.847.713 2.996 1.954 2.996 3.68 0 1.818-1.382 3.94-3.87 3.94-1.28 0-2.44-.305-3.328-1.576-.452-.647-.626-1.48-.656-2.314-.025-.64-.194-.78-.633-.78l-2.37.007V16h14.433V6.7l.007-.08z"/></g></svg></a><span class="tile-name">Sauce Labs</span><br><span class="hex">#EC4047</span></li>

View File

@ -88,8 +88,8 @@ var main = " <p class=\"hero\">" + source.icons.length + " SVG icons for
for (var i = 0; i < source.icons.length; i++) {
var fileName = source.icons[i].title.toLowerCase();
fileName = fileName.replace(/[ |!|.]/g, '');
fileName = fileName.replace(/[+]/, 'plus');
fileName = fileName.replace(/[!||.| ]/g, ''); // Replace bang, apostrophe, period and space with nothing.
fileName = fileName.replace(/[+]/, 'plus'); // Replace the plus symbol with “plus”.
filePath = "../icons/" + fileName + ".svg";
var fs = require('fs');
var svg = fs.readFileSync(filePath, 'utf8');

View File

@ -476,7 +476,7 @@
"source": "http://www.livejournal.com"
},
{
"title": "Macys",
"title": "Macys",
"hex": "E11A2B",
"source": "http://macys.com"
},