Skip to content

Commit

Permalink
Template choices now also use the Obsidian method for creating links …
Browse files Browse the repository at this point in the history
…to files
  • Loading branch information
chhoumann committed Jul 2, 2021
1 parent 9f61d7e commit a54c61e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "quickadd",
"name": "QuickAdd",
"version": "0.2.15",
"version": "0.2.16",
"minAppVersion": "0.12.00",
"description": "Quickly add new pages or content to your vault.",
"author": "Christian B. B. Houmann",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quickadd",
"version": "0.2.15",
"version": "0.2.16",
"description": "Quickly add new pages or content to your vault.",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions src/engine/TemplateChoiceEngine.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type ITemplateChoice from "../types/choices/ITemplateChoice";
import type {App, TFile} from "obsidian";
import {appendToCurrentLine, getAllFolders} from "../utility";
import {MARKDOWN_FILE_EXTENSION_REGEX, VALUE_SYNTAX} from "../constants";
import {VALUE_SYNTAX} from "../constants";
import {log} from "../logger/logManager";
import type QuickAdd from "../main";
import {TemplateEngine} from "./TemplateEngine";
Expand Down Expand Up @@ -47,8 +47,7 @@ export class TemplateChoiceEngine extends TemplateEngine {
}

if (this.choice.appendLink) {
const linkString = `[[${createdFile.path.replace(MARKDOWN_FILE_EXTENSION_REGEX, '')}]]`;
appendToCurrentLine(linkString, this.app);
appendToCurrentLine(this.app.fileManager.generateMarkdownLink(createdFile, ''), this.app);
}

if (this.choice.openFile) {
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"0.2.15": "0.12.4"
"0.2.16": "0.12.4"
}

0 comments on commit a54c61e

Please sign in to comment.