md文本图片加载不出来处理,ai-代码库不显示AI-RESOURCE创建者

This commit is contained in:
谢思 2026-05-29 16:45:07 +08:00
parent 2f43e7dfe0
commit cce6d8d29d
2 changed files with 13 additions and 2 deletions

View File

@ -66,7 +66,7 @@ function List(props) {
const { projectProperties, id } = row;
return {
id: id,
name: projectProperties.name,
name: projectProperties.fromOwner === "AI-RESOURCE" ? projectProperties.name.split("/").pop() : projectProperties.name,
image: projectProperties.authorImageUrl,
isNew: false,
url: projectProperties.fullName,

View File

@ -135,6 +135,14 @@ export default ({
}
}
// - 使
const handleImageError = (e) => {
const img = e.target;
//
if (img.src === imgError) return;
img.src = imgError;
};
useEffect(() => {
if (el.current && html) {
if (html.match(preRegex)) {
@ -143,8 +151,11 @@ export default ({
}
if (el.current) {
el.current.addEventListener('click', onAncherHandler)
// 使
el.current.addEventListener('error', handleImageError, true);
return () => {
el.current.removeEventListener('click', onAncherHandler)
el.current.removeEventListener('click', onAncherHandler);
el.current.removeEventListener('error', handleImageError, true);
resetMathExpressions()
cleanToc()
}