Skip to content

Commit

Permalink
Support more complicated expression (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhlongviolin1 authored Nov 7, 2023
1 parent a38accb commit 0686abf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/markdownIt/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const parseMockData = (value: string): string => {
}
}
}
value = value.replace(new RegExp(searchString, "g"), replaceData);
const escapedSearchString = searchString.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
value = value.replace(new RegExp(escapedSearchString, "g"), replaceData);
}
} catch (error: any) {
getLog().error(l10n.t("Parse mock data file: "), error.message || error);
Expand Down

0 comments on commit 0686abf

Please sign in to comment.