chore: 移除部分无用代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m37s

This commit is contained in:
2025-11-14 11:06:09 +08:00
parent 54d0e297ea
commit 17d10a7d80
3 changed files with 1 additions and 35 deletions

View File

@ -18,17 +18,3 @@ export function renderMarkdown(content: string): string {
return dirtyHtml;
}
export function convertMedia(content: string): string {
// 通过正则表达式替换Markdown中的图片链接
// ![alt text](image-url) -> ![alt text](strapiMedia(image-url))
if (!content) return '';
const contentWithAbsoluteUrls = content.replace(
/!\[([^\]]*)\]\((\/uploads\/[^)]+)\)/g,
(_, alt, url) => `![${alt}](${useStrapiMedia(url)})`
);
return contentWithAbsoluteUrls;
}