Skip to content

Commit

Permalink
fixed bug in export images
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanopagliari committed Jul 20, 2022
1 parent 5c59d9f commit 4e3eaa5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bibnotes",
"name": "BibNotes Formatter",
"version": "0.9.203",
"version": "0.9.205",
"minAppVersion": "0.12.0",
"description": "Plugin to import and format annotations from Zotero.",
"author": "Stefano Pagliari",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bibnotes",
"version": "0.9.203",
"version": "0.9.205",
"description": "Plugin to export and format annotations from Zotero into Obsidian",
"main": "main.js",
"scripts": {
Expand Down
13 changes: 7 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,9 @@ export default class MyPlugin extends Plugin {
selectedEntry.localLibrary =
"[Zotero](" + selectedEntry.select + ")";
selectedEntry.localLibraryLink = selectedEntry.select;
console.log(selectedEntry.localLibrary)
console.log(selectedEntry.localLibraryLink)

}

//create field file
//if (selectedEntry.hasOwnProperty("attachment.")){
selectedEntry.file = createLocalFileLink(selectedEntry);
Expand Down Expand Up @@ -1112,6 +1111,7 @@ export default class MyPlugin extends Plugin {
}
return false;
});

if (containsHighlightCommentTag == true){lineElements.colourTemplate = colourTransformation}
else {lineElements.colourTemplate = this.settings.highlightExportTemplate}

Expand Down Expand Up @@ -1302,7 +1302,6 @@ export default class MyPlugin extends Plugin {
} else {
lineElements.highlightFormatted = "";
lineElements.highlightFormattedNoPrepend= ""}


// ADD FORMATTING TO THE COMMENTS
if(lineElements.commentText != "" && lineElements.highlightText!=""){
Expand Down Expand Up @@ -1388,7 +1387,10 @@ export default class MyPlugin extends Plugin {
//

//Extract from the setting the template for exporitng the highlight/comment/tag for different colours

if (typeof lineElements.colourTemplate == 'undefined'){lineElements.colourTemplate = this.settings.highlightExportTemplate}

if(lineElements.colourTemplate.length==0){lineElements.colourTemplate= ""}

lineElements.colourTemplateFormatted = lineElements.colourTemplate.replace("{{highlight}}", lineElements.highlightFormatted)
lineElements.colourTemplateFormatted = lineElements.colourTemplateFormatted.replace("{{comment}}", lineElements.commentFormatted)
lineElements.colourTemplateFormatted = lineElements.colourTemplateFormatted.replace("{{tag}}", lineElements.inlineTagsFormatted)
Expand Down Expand Up @@ -2531,7 +2533,6 @@ export default class MyPlugin extends Plugin {
}

checkSQLite(){
//console.log("launch SQLITE")



Expand Down
3 changes: 2 additions & 1 deletion src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export class fuzzySelectEntryFromJson extends FuzzySuggestModal<Reference> {
this.plugin.settings.bibPath
);
const data = JSON.parse(rawdata.toString()); // rawdata is a buffer, convert to string

console.log(data)
console.log(data.items)
//const checkAdmonition = this.app.plugins.getPlugin("obsidian-admonition")._loaded

const bibtexArray: Reference[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export function createLocalFileLink(reference: Reference) {
const selectedfile: string =
"[" +
reference.attachments[attachmentindex].title +
"](file:///" + // added an extra "/" to make it work on Linux
"](file:////" + // added an extra "/" to make it work on Linux
encodeURI(reference.attachments[attachmentindex].path.replaceAll(" ", " ")) +
")"; //select the author

Expand Down

0 comments on commit 4e3eaa5

Please sign in to comment.