hematite 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/scss/_fonts.scss +1 -1
- data/assets/js/search.mjs +12 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5428a81a66f2c162d5db506a782443ab49ec31a2a2b67a02dec1cab941828768
|
4
|
+
data.tar.gz: 4a54bb491b61987364791315c6b4024b6fc019a3ba42f5488f43fb7f9c9ff704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08188e55d1fc0e2f342a186ac1cc57c0226fe7b138cdb5e2f622716b29f4a5cf41768220f9dafb3971d2081dfef5cbee1cb8f485cd6e041589b6a3472a63204f'
|
7
|
+
data.tar.gz: 1ddbfb8aa3b14052e0befc9e5dc6b59f1486705dc5f82033337a08a085368e27b6b1a51601db7e26b9578af0fafe74c0b3951a0e3fcda496ff5de23b35ad4b88
|
data/_includes/scss/_fonts.scss
CHANGED
data/assets/js/search.mjs
CHANGED
@@ -50,15 +50,25 @@ class Searcher {
|
|
50
50
|
.replaceAll(/[&]ldquo;/g, '"')
|
51
51
|
.replaceAll(/[&]rdquo;/g, '"')
|
52
52
|
.replaceAll(/[&]amp;/g, "&")
|
53
|
+
// Remove the astrisks around **bolded** text
|
54
|
+
.replaceAll(/(\s|^)[*]{2}[^*]+[*]{2}(\s|$)/g, "$1$2$3")
|
55
|
+
// Remove the backticks around `text` that is code-formatted
|
56
|
+
.replaceAll(/(\s|^)[`]([^`]+)[`](\s|$)/g, "$1$2$3") // `
|
53
57
|
.replaceAll(/\s+/g, ' ');
|
54
58
|
|
55
59
|
}
|
56
60
|
|
61
|
+
filterQuery_(query) {
|
62
|
+
return query
|
63
|
+
.toLowerCase()
|
64
|
+
.replaceAll(/\s+/g, ' ');
|
65
|
+
}
|
66
|
+
|
57
67
|
/// Get number of full matches for [query] in [text].
|
58
68
|
/// @precondition [text] is already in a searchable (i.e.
|
59
69
|
/// filtered) form.
|
60
70
|
getNumberOfMatches(query, text) {
|
61
|
-
query =
|
71
|
+
query = this.filterQuery_(query);
|
62
72
|
|
63
73
|
return text.toLowerCase().split(query).length - 1;
|
64
74
|
}
|
@@ -68,7 +78,7 @@ class Searcher {
|
|
68
78
|
/// is found.
|
69
79
|
/// @precondition [text] is already in a searchable form.
|
70
80
|
getIdxOfFirstMatch(query, text, startPos) {
|
71
|
-
query =
|
81
|
+
query = this.filterQuery_(query);
|
72
82
|
|
73
83
|
return text.toLowerCase().indexOf(query, startPos);
|
74
84
|
}
|