mirror of
https://github.com/lizard-heart/obsidian-to-omnifocus.git
synced 2026-07-22 07:30:26 +00:00
fix
This commit is contained in:
parent
65c349aa38
commit
d241bcc208
1 changed files with 31 additions and 2 deletions
33
src/main.ts
33
src/main.ts
|
|
@ -63,7 +63,8 @@ export default class ListModified extends Plugin {
|
|||
try {
|
||||
let currentTitle = view.file.path
|
||||
let qmdTitle = currentTitle.split(".")[0] + ".qmd"
|
||||
var newText = editorText.replace(/(```)(ad.*\n)([\s\S]*?\n)(```)/g, `::: $2\n$3:::`)
|
||||
let newText = editorText.replace(/(:::)({.*\n)([\s\S]*?\n)(:::)/g, "```ad-note \n$3:```")
|
||||
|
||||
|
||||
await this.app.vault.create(qmdTitle, newText);
|
||||
|
||||
|
|
@ -93,7 +94,35 @@ export default class ListModified extends Plugin {
|
|||
try {
|
||||
let currentTitle = view.file.path
|
||||
let qmdTitle = currentTitle.split(".")[0] + ".qmd"
|
||||
let newText = editorText.replace(/(:::)({.*\n)([\s\S]*?\n)(:::)/g, "```ad-note \n$3:```")
|
||||
var newText = editorText.replace(/(```)(ad.*\n)([\s\S]*?\n)(```)/g, `::: $2\n$3:::`)
|
||||
newText = newText.replace("ad-note", this.settings.adnote);
|
||||
newText = newText.replace("ad-seealso", this.settings.adseealso);
|
||||
newText = newText.replace("ad-abstract", this.settings.adabstract);
|
||||
newText = newText.replace("ad-summary", this.settings.adsummary);
|
||||
newText = newText.replace("ad-tldr", this.settings.adtldr);
|
||||
newText = newText.replace("ad-info", this.settings.adinfo);
|
||||
newText = newText.replace("ad-todo", this.settings.adtodo);
|
||||
newText = newText.replace("ad-tip", this.settings.adtip);
|
||||
newText = newText.replace("ad-hint", this.settings.adhint);
|
||||
newText = newText.replace("ad-important", this.settings.adimportant);
|
||||
newText = newText.replace("ad-success", this.settings.adsuccess);
|
||||
newText = newText.replace("ad-check", this.settings.adcheck);
|
||||
newText = newText.replace("ad-done", this.settings.addone);
|
||||
newText = newText.replace("ad-question", this.settings.adquestion);
|
||||
newText = newText.replace("ad-help", this.settings.adhelp);
|
||||
newText = newText.replace("ad-faq", this.settings.adfaq);
|
||||
newText = newText.replace("ad-warning", this.settings.adwarning);
|
||||
newText = newText.replace("ad-caution", this.settings.adcaution);
|
||||
newText = newText.replace("ad-attention", this.settings.adattention);
|
||||
newText = newText.replace("ad-failure", this.settings.adfailure);
|
||||
newText = newText.replace("ad-fail", this.settings.adfail);
|
||||
newText = newText.replace("ad-missing", this.settings.admissing);
|
||||
newText = newText.replace("ad-danger", this.settings.addanger);
|
||||
newText = newText.replace("ad-error", this.settings.aderror);
|
||||
newText = newText.replace("ad-bug", this.settings.adbug);
|
||||
newText = newText.replace("ad-example", this.settings.adexample);
|
||||
newText = newText.replace("ad-quote", this.settings.adquote);
|
||||
newText = newText.replace("ad-cite", this.settings.adcite);
|
||||
|
||||
await this.app.vault.create(qmdTitle, newText);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue