mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
fix resolveOpts props error in md image
This commit is contained in:
parent
88158289d2
commit
cab701d3ea
@ -89,6 +89,8 @@ const MarkdownImg = (props: any) => {
|
||||
const [resolvedStr, setResolvedStr] = useState<string>(null);
|
||||
const [resolving, setResolving] = useState<boolean>(true);
|
||||
const resolveOpts: MarkdownResolveOpts = props.resolveOpts;
|
||||
const propsScrubbed = { ...props };
|
||||
delete propsScrubbed.resolveOpts;
|
||||
|
||||
useEffect(() => {
|
||||
if (props.src.startsWith("http://") || props.src.startsWith("https://")) {
|
||||
@ -132,7 +134,7 @@ const MarkdownImg = (props: any) => {
|
||||
return <span>{resolvedStr}</span>;
|
||||
}
|
||||
if (resolvedSrc != null) {
|
||||
return <img {...props} src={resolvedSrc} />;
|
||||
return <img {...propsScrubbed} src={resolvedSrc} />;
|
||||
}
|
||||
return <span>[img]</span>;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user