summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2024-04-05 21:05:39 -0400
committerGitHub <noreply@github.com>2024-04-05 21:05:39 -0400
commit3c58ec27222fcde34874bfac7ba3c5fa77188020 (patch)
tree770d6c2214d8561f12289c999852a50247b4cf43
parent37c9bc4749fee0b7305dc2032e16d7e0519a27e0 (diff)
parent0deb72d4b9e04612abbb00587c008d8492b39626 (diff)
downloadPerlNavigator-3c58ec27222fcde34874bfac7ba3c5fa77188020.zip
Merge pull request #117 from IAKOBVS/main
replace regex replace with string replace
-rw-r--r--server/src/completion.ts2
-rw-r--r--server/src/pod.ts2
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