Replies: 2 comments 1 reply
-
Before we think through options around how to work around the problem, I wonder if you could help me understand why the backticks are a problem? I might be misunderstanding, but, if you're running some sort of custom Javascript via Templater, wouldn't it be possible to remove the backticks in that logic? |
Beta Was this translation helpful? Give feedback.
-
I came here with the opposite request)) |
Beta Was this translation helpful? Give feedback.
-
Hi @coddingtonbear -- amazing work on this extension! I definitely think it is a must-have for any Obsidian user!
I'd like a way to remove all backticks from the page content BEFORE it is written to the Obsidian note. In my use-case, I'm trying to pass the entire page content to OpenAI to autogenerate a summary. The below works, but ONLY if
page.content
doesn't have backticks. If a backtick is there, Templater blows up and can't process the note.This entire thing is pasted into the
Capture page snapshot
template. You can see the Templater start<%*
and end%>
tags. The second line is the problem. For some articles, it works smoothly -- the entire content is temporarily added to the Obsidian note, Templater kicks in and processes the OpenAI call, and then returns the summary, which is then embedded in the template with<% summary %>
.I think adding something like this in
handlebars.ts
might help:Then at the top of my obsidian-web template, I could do something like this:
If you are okay with the idea, I can try to put together a small PR with the changes.
Thanks again for this awesome tool!
Beta Was this translation helpful? Give feedback.
All reactions