Comments (6)
Instead of a timeout I would recommend seeing if the hooks module resolves the issue for you. Try wrapping your editor changes in the on_all_templates_executed
hook.
from templater.
Thanks @Zachatoo but I updated my code to use hooks, and still can't get it to work in 2.3.2. I updated the top post to point to a new version of the script that uses tp.hooks.on_all_templates_executed()
from templater.
I might have a problem related to this. All my templates that use regex are built with the following structure / logic:
<%*
// based on the following example: https://github.com/SilentVoid13/Templater/discussions/255; relevant for other
var content = tp.file.content;
content = content.replace(/updated:(.*)/g, "updated: " + tp.date.now("YYYY-MM-DDTHH:mm:ss"));
var file = app.workspace.activeLeaf.view.file; // *get current file*
app.vault.modify(file, content); // *replace content with new content*
%>
This stopped working for me with 2.3.2.
I see a flicker where content is replaced as expected and then after a split second, things revert. It would be great to know if this is a bug or intended behavior and how I might need to adjust all of my templater templates for this to work.
from templater.
frontmatter just flickers and gets replaced with the save content as before
I was able to reproduce a similar issue when using "Create new note from template" with a simple template that includes tp.hooks.on_all_templates_executed
to add frontmatter: #1309 (comment)
After the template insertion fix in 2.3.2, template insertion works (surprise!), but the frontmatter disappears when using "create new note from template" with the same template.
from templater.
Not quite sure how, but I fixed my template and it's working with 2.3.2 now.
from templater.
Should be fixed in 2.3.3.
from templater.
Related Issues (20)
- Embedded image causes Obsidian to lock up for 45 seconds in renderer HOT 1
- Link to a new file will trigger Templater in a specific folder HOT 2
- Feature request: allow for ordering which templater code is excuted first HOT 2
- Templater updates new file's last modified timestamp even if no templater code was run
- SImple syntax not displaying values correctly HOT 2
- Suggestion to Improve New Folder Template Addition Behavior in Templater Settings HOT 1
- Bug | tp.date.now() will incorrectly parse the last week of the year and first week of the next year HOT 2
- Random picture generator inoperable HOT 15
- First character of file path cut off in command palette if no templates folder set HOT 8
- Minify main.js HOT 1
- Add support for vanilla template variables like {{data}} for enhanced compatibility
- Using tp.file.rename doesn't rename current note but creates a new note instead HOT 1
- System Prompt in file order HOT 3
- First letter of every file cut off in search modal HOT 1
- template mis-applied when a note is created but not opened HOT 1
- generate_folder() has incorrect `relative` logic vs generate_path() HOT 1
- Syntax highlight on desktop causes the leading part of unordered list in table cell to disappear HOT 1
- Request: Zipped release for manual install
- Duplication bug when using Multiple Cursors
- Templater web requests not working on Obsidian mobile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templater.