diff --git a/src/markdownIt/utils.ts b/src/markdownIt/utils.ts index 0b5e400..8cfd68d 100644 --- a/src/markdownIt/utils.ts +++ b/src/markdownIt/utils.ts @@ -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);