Skip to content

Commit

Permalink
fix: keep basename instead of alt text
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 8, 2022
1 parent 46fb818 commit 92e89d5
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions plugin/contents_conversion/filePathConvertor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ function isShared(
): boolean {
const shared =
frontmatter && frontmatter[sharekey] ? frontmatter[sharekey] : false;
return !!(
shared ||
(!shared && frontmatterSettings.convertInternalNonShared)
);
if (shared) return true;
return !shared && frontmatterSettings.convertInternalNonShared === true;

}

/**
Expand Down Expand Up @@ -108,17 +107,14 @@ async function createRelativePath(
const isFromAnotherRepo = checkIfRepoIsInAnother(sourceRepo, targetRepo);
const shared = isShared(
settings.shareKey,
frontmatter,
frontmatterTarget,
frontmatterSettings
);
if (
(targetFile.linked.extension === "md" && isFromAnotherRepo === false) ||
shared === false
) {
console.log(
`${targetFile.linked.name} is not shared/not to be converted`
);
return targetFile.altText;
return targetFile.linked.basename;
}
if (targetFile.linked.path === sourceFile.path) {
return getReceiptFolder(targetFile.linked, settings, metadata, vault)
Expand Down

0 comments on commit 92e89d5

Please sign in to comment.