style: 格式化项目代码

- 根据prettier配置格式化整个项目的代码
This commit is contained in:
2025-09-17 15:50:29 +08:00
parent bb89721f1c
commit 359aaec8a9
43 changed files with 1900 additions and 1878 deletions

View File

@ -1,4 +1,4 @@
import MarkdownIt from "markdown-it";
import MarkdownIt from 'markdown-it';
const md = new MarkdownIt({
html: true,
@ -10,8 +10,8 @@ const md = new MarkdownIt({
export function renderMarkdown(content: string): string {
const dirtyHtml = md.render(content);
if (typeof window !== "undefined") {
import("dompurify").then((DOMPurify) => {
if (typeof window !== 'undefined') {
import('dompurify').then((DOMPurify) => {
return DOMPurify.default.sanitize(dirtyHtml);
});
}
@ -23,7 +23,7 @@ export function convertMedia(content: string): string {
// 通过正则表达式替换Markdown中的图片链接
// ![alt text](image-url) -> ![alt text](strapiMedia(image-url))
if (!content) return "";
if (!content) return '';
const contentWithAbsoluteUrls = content.replace(
/!\[([^\]]*)\]\((\/uploads\/[^)]+)\)/g,