Skip to content

Commit

Permalink
added #<112> encoded uri output format
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis Kafieh committed Oct 26, 2024
1 parent 6f8eefa commit 97cb451
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TFile, moment } from "obsidian";
import { getLogNote } from "../../log_note/logNote";
import { getPlugin, getSettings } from "../../settings/settings";
import { FileMetadataCacheProvider } from "../../../interfaces/context/FileMetadataCacheProvider";
import { file } from "bun";

export class ObsidianReplacementDictionary extends ReplacementDictionary {
replacements = [
Expand Down Expand Up @@ -34,6 +35,12 @@ export class ObsidianReplacementDictionary extends ReplacementDictionary {
replaceWith: (file: File) =>
moment(file.stat.mtime).format(getSettings().timeFormat),
},
{
template: "uri",
replaceWith: (file: File) =>
// @ts-ignore - getObsidianUrl undocumented
`[${file.basename}](${getPlugin().app.getObsidianUrl(file)})`,
},
];
}

Expand Down
Loading

0 comments on commit 97cb451

Please sign in to comment.