Skip to content

Commit

Permalink
Fix issue where images and transcluded text was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Eskild Steensen committed Mar 10, 2022
1 parent 0cdc4b3 commit eeeea28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class Publisher {
async generateMarkdown(file: TFile): Promise<string> {
let text = await this.vault.cachedRead(file);
text = await this.convertFrontMatter(text, file.path);
text = await this.convertLinksToFullPath(text, file.path);
text = await this.createTranscludedText(text, file.path);
text = await this.convertLinksToFullPath(text, file.path);
text = await this.createBase64Images(text, file.path);
return text;

Expand Down Expand Up @@ -167,8 +167,10 @@ class Publisher {
const fullLinkedFilePath = getLinkpath(linkedFileName);
const linkedFile = this.metadataCache.getFirstLinkpathDest(fullLinkedFilePath, filePath);

const extensionlessPath = linkedFile.path.substring(0, linkedFile.path.lastIndexOf('.'));
convertedText = convertedText.replace(linkedFileMatch,`[[${extensionlessPath}|${prettyName}]]`);
if(linkedFile.extension === "md"){
const extensionlessPath = linkedFile.path.substring(0, linkedFile.path.lastIndexOf('.'));
convertedText = convertedText.replace(linkedFileMatch,`[[${extensionlessPath}|${prettyName}]]`);
}
} catch {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class DigitalGarden extends Plugin {
appVersion: string;

async onload() {
this.appVersion = "2.1.2";
this.appVersion = "2.1.3";

console.log("Initializing DigitalGarden plugin v" + this.appVersion);
await this.loadSettings();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "digitalgarden",
"name": "Digital Garden",
"version": "2.1.2",
"version": "2.1.3",
"minAppVersion": "0.12.0",
"description": "Publish your notes to a digital garden for others to enjoy.",
"author": "Ole Eskild Steensen",
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"2.1.3": "0.12.0",
"2.1.2": "0.12.0",
"2.1.1": "0.12.0",
"2.1.0": "0.12.0",
Expand Down

0 comments on commit eeeea28

Please sign in to comment.