diff --git a/manifest.json b/manifest.json index 3abcc83..30512ec 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.2.21", + "version": "1.2.22", "minAppVersion": "0.12.0", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawData.ts b/src/ExcalidrawData.ts index 4a88a30..ba66388 100644 --- a/src/ExcalidrawData.ts +++ b/src/ExcalidrawData.ts @@ -310,7 +310,7 @@ export class ExcalidrawData { if(isParagraphRef) { let para = blocks.filter((block:any)=>block.node.id == id)[0]?.node; if(!para) return text; - if(para.type=="blockquote") para = para.children[0]; //blockquotes are special, they have one child, which has the paragraph + if(["blockquote","listItem"].includes(para.type)) para = para.children[0]; //blockquotes are special, they have one child, which has the paragraph const startPos = para.position.start.offset; const endPos = para.children[para.children.length-1]?.position.start.offset-1; //alternative: filter((c:any)=>c.type=="blockid")[0] return contents.substr(startPos,endPos-startPos) diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index acedacc..7cb4a7d 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -663,7 +663,6 @@ export default class ExcalidrawView extends TextFileView { //variables used to handle click events in view mode let selectedTextElement:{id:string,text:string} = null; let timestamp = 0; - let blockOnCtrlKeyDown = false; let blockOnMouseButtonDown = false; const getTextElementAtPointer = (pointer:any) => { @@ -703,10 +702,7 @@ export default class ExcalidrawView extends TextFileView { this.ctrlKeyDown = e.ctrlKey; this.shiftKeyDown = e.shiftKey; this.altKeyDown = e.altKey; - if(!blockOnCtrlKeyDown && e.ctrlKey) { - blockOnCtrlKeyDown = true; - clearHoverPreview(); - }; + if(e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) { const selectedElement = getTextElementAtPointer(currentPosition); if(!selectedElement) return; @@ -722,9 +718,6 @@ export default class ExcalidrawView extends TextFileView { let linktext = REGEX_LINK.getLink(parts); //parts.value[2] ? parts.value[2]:parts.value[6]; if(linktext.match(REG_LINKINDEX_HYPERLINK)) return; - if(linktext.search("#")>-1) linktext = linktext.substring(0,linktext.search("#")); - const file = this.app.metadataCache.getFirstLinkpathDest(linktext,this.file.path); - if (!file) return; this.plugin.hover.linkText = linktext; this.plugin.hover.sourcePath = this.file.path; @@ -735,6 +728,7 @@ export default class ExcalidrawView extends TextFileView { hoverParent: hoverPreviewTarget, targetEl: hoverPreviewTarget, linktext: this.plugin.hover.linkText, + sourcePath: this.plugin.hover.sourcePath }); hoverPoint = currentPosition; if(document.fullscreenElement === this.contentEl) { @@ -747,7 +741,6 @@ export default class ExcalidrawView extends TextFileView { } }, onKeyUp: (e:any) => { - blockOnCtrlKeyDown = e.ctrlKey; this.ctrlKeyDown = e.ctrlKey; this.shiftKeyDown = e.shiftKey; this.altKeyDown = e.altKey; diff --git a/versions.json b/versions.json index 7c76463..43df376 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.2.21": "0.11.13" + "1.2.22": "0.11.13" }