From 7f1743a816b9e3f5933998c18468f369f9e8bf9b Mon Sep 17 00:00:00 2001 From: Jacob Levernier Date: Fri, 6 Jan 2023 08:39:46 -0500 Subject: [PATCH] Fixed bug whereby Windows downloaded attachments would not always work (being interpreted as C:/C:/...) --- main.ts | 6 +----- manifest.json | 2 +- package.json | 2 +- versions.json | 3 ++- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/main.ts b/main.ts index 2a2fb67..428895f 100644 --- a/main.ts +++ b/main.ts @@ -354,11 +354,7 @@ export default class PastetoIndentationPlugin extends Plugin { // file: // !new RegExp("^([a-zA-Z])+://").test(src); if (srcIsLocalFile) { - let urlForDownloading = src; - - if (src.startsWith("file:///")) { - urlForDownloading = src.replace(/^file:\/\/\//, ""); - } + const urlForDownloading = src.replace(/^file:\/{2,3}/, ""); dataBlob = new Blob([ await FileSystemAdapter.readLocalFile(urlForDownloading), diff --git a/manifest.json b/manifest.json index 04e243a..c14e478 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-paste-to-current-indentation", "name": "Paste Mode", - "version": "5.0.0", + "version": "5.0.1", "minAppVersion": "1.0.0", "description": "Paste content and mark block quotes at any level of indentation.", "author": "Jacob Levernier", diff --git a/package.json b/package.json index c23fa78..7bf4e0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-paste-to-current-indentation", - "version": "5.0.0", + "version": "5.0.1", "description": "This plugin allows pasting and marking text as block-quotes at any level of indentation.", "main": "main.js", "scripts": { diff --git a/versions.json b/versions.json index 5649ebc..6d5c574 100644 --- a/versions.json +++ b/versions.json @@ -12,5 +12,6 @@ "3.0.2": "0.14.6", "3.1.0": "0.14.6", "4.0.0": "0.14.6", - "5.0.0": "1.0.0" + "5.0.0": "1.0.0", + "5.0.1": "1.0.0" }