mo-seph / obsidian-note-from-template

Simple plugin to create Notes from a template, and fill in fields defined there
MIT License
108 stars 9 forks source link

Default regex in plugin setting does not work #48

Closed Alega-ua closed 10 months ago

Alega-ua commented 1 year ago

template-input If the command is called with some text selected, split it up using the plugin's split pattern, and put the values into those fields

Default regex in plugin setting does not work - it does not split the input into title and body \s+-s+

image

Template code

---
template-input: title, body
---

# {{title}}
{{body}}
mo-seph commented 1 year ago

It works here - what text did you have highlighted when you called the template?

mo-seph commented 10 months ago

BTW - it looks like your regex is missing a backslash - in the screenshot, it is \s+-s+, not \s+-\s+.

Alega-ua commented 10 months ago

\s+-s+ is the default value I have after installation - I changed nothing

mo-seph commented 10 months ago

I've just installed into a fresh vault, and I get the correct regex \s+-\s+. I'll try to keep an eye out for this, but unless I can reproduce it it's going to be hard to fix. I've updated the description in the settings to say what it should start out as in case someone else runs into the same thing.