mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-01-17 23:51:08 +03:00
Fix inconcistent search results due to search term normalization (#983)
Closes #981
This commit is contained in:
parent
046c5e8b45
commit
856d37bdb8
11
index.html
11
index.html
@ -146,11 +146,11 @@
|
||||
{% assign allIconNames = "" %}
|
||||
{% for icon in iconsArray %}
|
||||
{% assign iconArray = icon | split: "," %}
|
||||
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[3] }}",{% endcapture %}
|
||||
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[5] }}",{% endcapture %}
|
||||
{% endfor %}
|
||||
{% for icon in greyscaleIconsArray %}
|
||||
{% assign iconArray = icon | split: "," %}
|
||||
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[1] }}"{% unless forloop.last %},{% endunless %}{% endcapture %}
|
||||
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[5] }}"{% unless forloop.last %},{% endunless %}{% endcapture %}
|
||||
{% endfor %}
|
||||
|
||||
<!doctype html>
|
||||
@ -191,12 +191,7 @@
|
||||
</script>
|
||||
<script>
|
||||
function normalizeSearchTerm(value) {
|
||||
return value.toLowerCase()
|
||||
.replace(/\+/g, "plus")
|
||||
.replace(/^\./, "dot-")
|
||||
.replace(/\.$/, "-dot")
|
||||
.replace(/\./g, "-dot-")
|
||||
.replace(/[ !’]/g, '');
|
||||
return value.toLowerCase();
|
||||
}
|
||||
var icons = [{{ allIconNames }}].map(normalizeSearchTerm);
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user