Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/js/search-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ function docTokenFunction (token) {
const namespaceRegex = /\:|\./
let toSplitWords = token.toString()

// clean up leading and trailing backticks
if (toSplitWords.startsWith('`') && toSplitWords.endsWith('`')) {
toSplitWords = toSplitWords.slice(1, -1)
tokens.push(token.clone().update(() => toSplitWords))
}

if (arityRegex.test(toSplitWords)) {
const withoutArity = token
.toString()
Expand Down Expand Up @@ -188,6 +194,10 @@ function docTokenFunction (token) {
// also make it searchable as foo_bar
toSplitWords = toSplitWords.substring(1)
tokens.push(token.clone().update(() => toSplitWords))
} else if (toSplitWords.startsWith(':')) {
// allow searching for atoms without `:`
toSplitWords = toSplitWords.slice(1)
tokens.push(token.clone().update(() => toSplitWords))
}

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