diff --git a/main.ts b/main.ts index 7927da1..ddb1e45 100644 --- a/main.ts +++ b/main.ts @@ -145,7 +145,16 @@ export default class MyPlugin extends Plugin { // Get Parameters let parameters: PdfNodeParameters = null; try { - parameters = JSON.parse(node.innerText); + + var rawText = node.innerText; + + // "url" : [[file.pdf]] is an invalid json since it misses quotation marks in value + if(rawText.contains("[[") && !rawText.contains("\"[[")){ + rawText = rawText.replace("[[","\"[["); + rawText = rawText.replace("]]","]]\""); + } + + parameters = JSON.parse(rawText); console.log(parameters); } catch (e) { console.log('Query was not valid JSON: ' + e.message); diff --git a/manifest.json b/manifest.json index 5c94273..8478934 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "id": "better-pdf-plugin", "name": "Better PDF Plugin", - "version": "1.0.2", - "minAppVersion": "0.9.12", + "version": "1.1.0", + "minAppVersion": "0.10.11", "description": "Goal of this Plugin in to implement a native PDF handling workflow", "author": "MSzturc", "authorUrl": "https://github.com/MSzturc", diff --git a/versions.json b/versions.json index 3c4f453..afa02ad 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { + "1.1.0": "0.10.11", "1.0.2": "0.9.12", "1.0.1": "0.9.12", "1.0.0": "0.9.7"