Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit fe12530

Browse files
committed
fix(plugins/plugin-client-common): Markdown renderer does not handle img tags with http src
Fixes #6818
1 parent 12d2508 commit fe12530

File tree

1 file changed

+4
-13
lines changed
  • plugins/plugin-client-common/src/components/Content

1 file changed

+4
-13
lines changed

plugins/plugin-client-common/src/components/Content/Markdown.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,12 @@ export default class Markdown extends React.PureComponent<Props> {
7575
) {
7676
const isLocal = !/^http/i.test(src)
7777
if (isLocal && this.props.fullpath) {
78-
const style = props ? { float: props.align } : undefined
7978
const absoluteSrc = isAbsolute(src) ? src : join(dirname(this.props.fullpath), src)
80-
81-
return (
82-
<img
83-
key={key}
84-
src={absoluteSrc}
85-
height={props.height}
86-
width={props.width}
87-
style={style}
88-
data-float={props.align}
89-
/>
90-
)
79+
src = absoluteSrc
9180
}
81+
82+
const style = props ? { float: props.align } : undefined
83+
return <img key={key} src={src} height={props.height} width={props.width} style={style} data-float={props.align} />
9284
}
9385

9486
public render() {
@@ -124,7 +116,6 @@ export default class Markdown extends React.PureComponent<Props> {
124116
}
125117
})
126118
.filter(_ => _)
127-
128119
return <React.Fragment>{imageTags}</React.Fragment>
129120
}
130121

0 commit comments

Comments
 (0)