diff options
-rw-r--r-- | server/src/completion.ts | 2 | ||||
-rw-r--r-- | server/src/pod.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/server/src/completion.ts b/server/src/completion.ts index dded519..2ec8c67 100644 --- a/server/src/completion.ts +++ b/server/src/completion.ts @@ -151,7 +151,7 @@ function getMatches(perlDoc: PerlDocument, symbol: string, replace: Range, strip if (goodMatch(perlDoc, elemName, qualifiedSymbol, symbol, bKnownObj)) { // Hooray, it's a match! // You may have asked for FOO::BAR->BAZ or $qux->BAZ and I found FOO::BAR::BAZ. Let's put back the arrow or variable before sending - const quotedSymbol = qualifiedSymbol.replace(/([\$])/g, "\\$1"); // quotemeta for $self->FOO + const quotedSymbol = qualifiedSymbol.replaceAll("$", "\\$"); // quotemeta for $self->FOO let aligned = elemName.replace(new RegExp(`^${quotedSymbol}`, "gi"), symbol); if (symbol.endsWith("-")) aligned = aligned.replaceAll('-:', "->"); // Half-arrows count too diff --git a/server/src/pod.ts b/server/src/pod.ts index f4a9596..e9be6ab 100644 --- a/server/src/pod.ts +++ b/server/src/pod.ts @@ -470,7 +470,7 @@ const escapeHTML = (str: string): string => { if (backtickCount % 2 !== 0 || segments.length % 2 === 0) { // Handle the unbalanced backticks here - str = str.replace(/`/g, ""); + str = str.replaceAll("`", ""); } // Escape special characters and create a regex pattern |