1
0

Fix image live preview

This commit is contained in:
Zef Hemel 2022-11-18 16:20:00 +01:00
parent 24c17a793f
commit 1edfb7cc67
2 changed files with 8 additions and 6 deletions

View File

@ -26,6 +26,14 @@ function hideNodes(view: EditorView) {
}).range(node.from),
);
}
if (
node.name === "Image" &&
!isCursorInRange(view.state, [node.from, node.to])
) {
widgets.push(invisibleDecoration.range(node.from, node.to));
}
if (
node.name === "FrontMatterMarker"
) {

View File

@ -48,12 +48,6 @@ const inlineImages = (view: EditorView) => {
return;
}
if (
!isCursorInRange(view.state, [node.from, node.to])
) {
widgets.push(invisibleDecoration.range(node.from, node.to));
}
const imageRexexResult = imageRegex.exec(
view.state.sliceDoc(node.from, node.to),
);