From e8a29a271503b4a6e40ece047f3df9025d5333fd Mon Sep 17 00:00:00 2001 From: Zsolt Viczian Date: Wed, 29 Sep 2021 06:50:51 +0200 Subject: [PATCH] 1.3.15 --- manifest.json | 2 +- src/ExcalidrawData.ts | 9 +++++++-- versions.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 8af29b3..15b2306 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.3.14", + "version": "1.3.15", "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 96df944..19fcde5 100644 --- a/src/ExcalidrawData.ts +++ b/src/ExcalidrawData.ts @@ -143,7 +143,12 @@ export class ExcalidrawData { let parts; while(!(parts = res.next()).done) { const text = data.substring(position,parts.value.index); - this.textElements.set(parts.value[1],{raw: text, parsed: await this.parse(text)}); + const id:string = parts.value[1]; + this.textElements.set(id,{raw: text, parsed: await this.parse(text)}); + //this will set the rawText field of text elements imported from files before 1.3.14, and from other instances of Excalidraw + const textEl = this.scene.elements.filter((el:any)=>el.id===id)[0]; + if(textEl && (!textEl.rawText || textEl.rawText === "")) textEl.rawText = text; + position = parts.value.index + BLOCKREF_LEN; } @@ -241,7 +246,7 @@ export class ExcalidrawData { dirty = true; } else if(!this.textElements.has(id)) { dirty = true; - const raw = (te.rawText!==""?te.rawText:te.text); //this is for compatibility with drawings created before the rawText change on ExcalidrawTextElement + const raw = (te.rawText && te.rawText!==""?te.rawText:te.text); //this is for compatibility with drawings created before the rawText change on ExcalidrawTextElement this.textElements.set(id,{raw: raw, parsed: null}); this.parseasync(id,raw); } diff --git a/versions.json b/versions.json index ff13ace..3b795ad 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.3.14": "0.11.13" + "1.3.15": "0.11.13" }