mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-01-29 21:40:35 +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 = "" %}
|
{% assign allIconNames = "" %}
|
||||||
{% for icon in iconsArray %}
|
{% for icon in iconsArray %}
|
||||||
{% assign iconArray = icon | split: "," %}
|
{% assign iconArray = icon | split: "," %}
|
||||||
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[3] }}",{% endcapture %}
|
{% capture allIconNames %}{{ allIconNames }}"{{ iconArray[5] }}",{% endcapture %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for icon in greyscaleIconsArray %}
|
{% for icon in greyscaleIconsArray %}
|
||||||
{% assign iconArray = icon | split: "," %}
|
{% 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 %}
|
{% endfor %}
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
@ -191,12 +191,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function normalizeSearchTerm(value) {
|
function normalizeSearchTerm(value) {
|
||||||
return value.toLowerCase()
|
return value.toLowerCase();
|
||||||
.replace(/\+/g, "plus")
|
|
||||||
.replace(/^\./, "dot-")
|
|
||||||
.replace(/\.$/, "-dot")
|
|
||||||
.replace(/\./g, "-dot-")
|
|
||||||
.replace(/[ !’]/g, '');
|
|
||||||
}
|
}
|
||||||
var icons = [{{ allIconNames }}].map(normalizeSearchTerm);
|
var icons = [{{ allIconNames }}].map(normalizeSearchTerm);
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user