mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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 [resolvedStr, setResolvedStr] = useState<string>(null);
|
||||||
const [resolving, setResolving] = useState<boolean>(true);
|
const [resolving, setResolving] = useState<boolean>(true);
|
||||||
const resolveOpts: MarkdownResolveOpts = props.resolveOpts;
|
const resolveOpts: MarkdownResolveOpts = props.resolveOpts;
|
||||||
|
const propsScrubbed = { ...props };
|
||||||
|
delete propsScrubbed.resolveOpts;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.src.startsWith("http://") || props.src.startsWith("https://")) {
|
if (props.src.startsWith("http://") || props.src.startsWith("https://")) {
|
||||||
@ -132,7 +134,7 @@ const MarkdownImg = (props: any) => {
|
|||||||
return <span>{resolvedStr}</span>;
|
return <span>{resolvedStr}</span>;
|
||||||
}
|
}
|
||||||
if (resolvedSrc != null) {
|
if (resolvedSrc != null) {
|
||||||
return <img {...props} src={resolvedSrc} />;
|
return <img {...propsScrubbed} src={resolvedSrc} />;
|
||||||
}
|
}
|
||||||
return <span>[img]</span>;
|
return <span>[img]</span>;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user