Skip to content

Commit

Permalink
Fix multireplace not working
Browse files Browse the repository at this point in the history
Signed-off-by: William So <[email protected]>
  • Loading branch information
polyipseity committed Sep 30, 2023
1 parent 3d5a2f8 commit 88b03ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/odd-beans-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polyipseity/obsidian-plugin-library": patch
---

Fix `multireplace` not working.
2 changes: 1 addition & 1 deletion sources/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ export function multireplace(
replacements: Map<string, string>,
): string {
return self0.replace(
alternativeRegExp(Object.keys(replacements)),
alternativeRegExp([...replacements.keys()]),
match => replacements.get(match) ?? match,
)
}
Expand Down

0 comments on commit 88b03ba

Please sign in to comment.