Skip to content

Commit

Permalink
fix: add support for any file supported by obsidian
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Sep 5, 2022
1 parent 777ba90 commit d22bc61
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugin/publishing/filesManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export class FilesManagement extends Publisher {
}
// @ts-ignore
const imageLink = this.metadataCache.getFirstLinkpathDest(field, path);
if (imageLink.name.match(/(png|jpe?g|svg|bmp|gif)$/i)) {
if (imageLink.name.match(/(md|png|jpe?g|gif|bmp|svg|mp[34]|webm|wav|m4a|ogg|3gp|flac|ogv|mov|mkv|pdf)$/i)) {
return imageLink;
}
return null
Expand All @@ -279,7 +279,7 @@ export class FilesManagement extends Publisher {
frontmatterSourceFile[field],
file.path
);
if (imageLink.name.match(/(png|jpe?g|svg|bmp|gif)$/i)) {
if (imageLink.name.match(/(md|png|jpe?g|gif|bmp|svg|mp[34]|webm|wav|m4a|ogg|3gp|flac|ogv|mov|mkv|pdf)$/i)) {
embedFiles.push(imageLink);
}
}
Expand All @@ -288,7 +288,6 @@ export class FilesManagement extends Publisher {
if (this.plugin.app.plugins.enabledPlugins.has('dataview')) {
const dvApi = getAPI();
const dataviewMetadata = await dvApi.page(file.path)
console.log(dataviewMetadata)
for (const field of this.settings.metadataFileFields) {
const fieldValue = dataviewMetadata[field];

Expand Down

0 comments on commit d22bc61

Please sign in to comment.