improving replace url features

This commit is contained in:
2025-08-21 08:55:29 -06:00
parent 224cc9cd2a
commit d1a768393c
6 changed files with 90 additions and 17 deletions

View File

@@ -90,14 +90,12 @@ export function markdownToHTMLSafe({
replaceText?: { source: string; destination: string }[];
}) {
const html = markdownToHtmlNoImages(markdownString);
if (convertImages) return convertImagesToCanvasImages(html, settings);
const replacedHtml = replaceText.reduce(
(acc, { source, destination }) => acc.replaceAll(source, destination),
html
);
// return html;
if (convertImages) return convertImagesToCanvasImages(replacedHtml, settings);
return replacedHtml;
}