Skip to content

Commit a625975

Browse files
authored
fix: [Application] When the image cannot be found, it is missing load_ error. png, resulting in repeated requests for the load_ error. png interface (#5042)
1 parent 04b6689 commit a625975

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ui/public/load_error.png

10.9 KB
Loading

ui/src/components/markdown/MdRenderer.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ config({
4343
markdownItConfig(md) {
4444
md.renderer.rules.image = (tokens, idx, options) => {
4545
tokens[idx].attrSet('style', 'display:inline-block;min-height:33px;padding:0;margin:0')
46-
tokens[idx].attrSet('onerror', 'this.src="/load_error.png"')
46+
tokens[idx].attrSet(
47+
'onerror',
48+
`
49+
this.onerror=null;
50+
if(!this.src.endsWith("load_error.png")){
51+
this.src="./load_error.png";
52+
}
53+
`,
54+
)
4755
return md.renderer.renderToken(tokens, idx, options)
4856
}
4957

0 commit comments

Comments
 (0)