Skip to content

Commit 674b72f

Browse files
committed
Make module attributes searchable without leading @
1 parent adb0971 commit 674b72f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

assets/js/search-page.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function b64decode (str) {
127127
}
128128

129129
function indexStorageKey () {
130-
return `idv4:${getProjectNameAndVersion()}`
130+
return `idv5:${getProjectNameAndVersion()}`
131131
}
132132

133133
function createIndex () {
@@ -183,6 +183,11 @@ function docTokenFunction (token) {
183183
}
184184

185185
toSplitWords = parts[parts.length - 1]
186+
} else if (toSplitWords.startsWith("@")) {
187+
// If we have a module attribute, such as @foo_bar,
188+
// also make it searchable as foo_bar
189+
toSplitWords = toSplitWords.substring(1);
190+
tokens.push(token.clone().update(() => toSplitWords))
186191
}
187192

188193
// Now split the function name (or the token, if that's all we had),

formatters/html/dist/html-5OPRASEH.js formatters/html/dist/html-YIPIRHGU.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)