diff --git a/src/tools/fetch/web-fetch-utils.ts b/src/tools/fetch/web-fetch-utils.ts index 39448c1..685555e 100644 --- a/src/tools/fetch/web-fetch-utils.ts +++ b/src/tools/fetch/web-fetch-utils.ts @@ -3,13 +3,13 @@ export type ExtractMode = "markdown" | "text"; function decodeEntities(value: string): string { return value .replace(/ /gi, " ") - .replace(/&/gi, "&") .replace(/"/gi, '"') .replace(/'/gi, "'") .replace(/</gi, "<") .replace(/>/gi, ">") .replace(/&#x([0-9a-f]+);/gi, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))) - .replace(/&#(\d+);/gi, (_, dec) => String.fromCharCode(Number.parseInt(dec, 10))); + .replace(/&#(\d+);/gi, (_, dec) => String.fromCharCode(Number.parseInt(dec, 10))) + .replace(/&/gi, "&"); } function stripTags(value: string): string {