Skip to content

Commit

Permalink
feat: adding multiple possibility to remove part links
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jul 14, 2022
1 parent 16dde85 commit 6e922ee
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mkdocsPublisher/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ async function createLink(file: TFile, settings: MkdocsPublicationSettings, meta
}
baseLink = checkSlash(baseLink);
if (settings.linkRemover.length > 0){
filepath = filepath.replace(settings.linkRemover, '')
const tobeRemoved = settings.linkRemover.split(',')
for (const part of tobeRemoved) {
if (part.length > 0) {
filepath = filepath.replace(part.trim(), '')
}
}
}
const url = encodeURI(baseLink + filepath)
new Notice(
(t("copylinkMsg") as StringFunc)(file.name)
)
const url = encodeURI(baseLink + filepath.replace(".md", ''))
await navigator.clipboard.writeText(url);
return;

Expand Down

0 comments on commit 6e922ee

Please sign in to comment.