Skip to content

Commit

Permalink
its now possible to use internal links as url
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthäus Szturc authored and Matthäus Szturc committed Jan 31, 2021
1 parent ac4c060 commit ea50255
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit ea50255

Please sign in to comment.