文件预览代码优化

This commit is contained in:
xintaofei
2026-03-17 00:35:14 +08:00
parent b4a6f70389
commit 0d913ebd94
2 changed files with 4 additions and 3 deletions

View File

@@ -1375,8 +1375,7 @@ export function FileWorkspacePanel() {
),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
a: ({ node, href, children, ...aProps }) => {
const isRelative =
href && !/^https?:\/\/|^mailto:|^#/.test(href)
const isRelative = href && !/^[a-z][a-z0-9+.-]*:|^#/i.test(href)
if (isRelative && href) {
return (
<a