Fix image live preview
This commit is contained in:
@@ -26,6 +26,14 @@ function hideNodes(view: EditorView) {
|
|||||||
}).range(node.from),
|
}).range(node.from),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
node.name === "Image" &&
|
||||||
|
!isCursorInRange(view.state, [node.from, node.to])
|
||||||
|
) {
|
||||||
|
widgets.push(invisibleDecoration.range(node.from, node.to));
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
node.name === "FrontMatterMarker"
|
node.name === "FrontMatterMarker"
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -48,12 +48,6 @@ const inlineImages = (view: EditorView) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
!isCursorInRange(view.state, [node.from, node.to])
|
|
||||||
) {
|
|
||||||
widgets.push(invisibleDecoration.range(node.from, node.to));
|
|
||||||
}
|
|
||||||
|
|
||||||
const imageRexexResult = imageRegex.exec(
|
const imageRexexResult = imageRegex.exec(
|
||||||
view.state.sliceDoc(node.from, node.to),
|
view.state.sliceDoc(node.from, node.to),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user