quickadd
quickadd copied to clipboard
[BUG] Templater includes cause weird issues
Describe the bug
I am using templates to create complex templates that are easier for me to edit and change things when needed. Templater allows you to write a line <% tp.file.include("[[Template 2]]") %>
which will insert a second template at this line when templater creates new or the templater templater: replace Templates in the active file
command is ran.
To Reproduce Steps to reproduce the behavior:
- With templater installed
- Create two templates:
# Header 1
<% tp.file.include("[[Template 2]]") %>
# Header 3
# Header 2
| Date / Time | Thought | Destruction | Talk Back |
-
Create a capture quick add: File name: {{DATE:[Calendar/Journal]/YYYY/MM_MMM/YYYY-[W]ww}}.md Create file if it doesn't exist: true Create file with given template: Template 1 Insert after: # Header 2 Insert at end of section: true Consider subsections: true (Even though both templates don't have subsections) Capture format: | [[{{DATE:YYYY-MM-DD}}]] {{DATE:ddd}} | | | | | {{DATE:h:m}} | {{value}} | | |
-
Run this quick add with any text for capture.
Expected behavior
I expected new rows to be added at the end of the table in template 2 > Header 2
Screenshots
This works if the file already exists.
But if I am creating the file for the first time the capture format does not get inserted anywere in the file.
If I am creating the file for the first time, and I switch Consider subsections
to false. Then the capture format is inserted in the middle of a different section for some reason.
I think this is due to not allowing templater to create the template and run its templater: replace Templates in the active file
command. If a file was created with template 1, and then the templater: replace Templates in the active file
command was ran, before quick add tried to insert the capture into the file, then the header it is looking for would be in the file and things would run as smoothly as if the file was already created.
Desktop (please complete the following information):
- OS: [Ubuntu]
- Version [23.10]
Smartphone (please complete the following information):
- Device: [Google Pixel 6 Pro]
- OS: [Android 14]