Skip to content

Commit 3fae579

Browse files
fix replaceMap
1 parent 0828d83 commit 3fae579

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ export const convertHeadingToHTMLFragment = (inlineText) => {
3535
* @returns {string} Text with all the keys replaced with their respective value.
3636
**/
3737
export const replaceMap = (text, replacementMap) =>{
38-
let og_text = text
3938
for (const key of Object.keys(replacementMap)) {
4039
let replacement = replacementMap[key]
4140
if (!!replacement){
42-
text = text.replace(key,replacement)
41+
text = text.replaceAll(key,replacement)
4342
}
4443
}
4544
return text

0 commit comments

Comments
 (0)