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), }).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"
) { ) {

View File

@ -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),
); );