Skip to content

Commit 621aa3d

Browse files
committed
Trim punctuation from tokens
1 parent 8bcbf19 commit 621aa3d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

assets/js/search-page.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,13 @@ function docTokenFunction (token) {
161161
const namespaceRegex = /\:|\./
162162
let toSplitWords = token.toString()
163163

164+
// remove punctuation at start and end, except for !?
165+
// at the end which can be part of the identifier itself
166+
toSplitWords.replace(/^[.,;?!]+|[.,;]+$/g, '')
167+
164168
// clean up leading and trailing backticks
165169
if (toSplitWords.startsWith('`') && toSplitWords.endsWith('`')) {
166170
toSplitWords = toSplitWords.slice(1, -1)
167-
tokens.push(token.clone().update(() => toSplitWords))
168171
}
169172

170173
if (arityRegex.test(toSplitWords)) {

formatters/html/dist/html-PVRIOB7F.js renamed to formatters/html/dist/html-FUIEFJA2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)