Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions np.Templating/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

See Plugin [Documentation](https://noteplan.co/templates/docs) for details on available commands and use case.

## [2.0.10] 2025-07-30 @dwertheimer
- Fix quick-note with frontmatter

## [2.0.9] 2025-07-27 @dwertheimer
- Fix xcallback bug in append and insert

Expand Down
4 changes: 2 additions & 2 deletions np.Templating/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"noteplan.minAppVersion": "3.9.10",
"plugin.id": "np.Templating",
"plugin.name": "📒 Templating",
"plugin.version": "2.0.9",
"plugin.lastUpdateInfo": "2.0.9: fix xcallback but in append and insert",
"plugin.version": "2.0.10",
"plugin.lastUpdateInfo": "2.0.10: fix quick-note with frontmatter",
"plugin.description": "Templating Plugin for NotePlan",
"plugin.author": "Mike Erickson ( codedungeon)",
"plugin.dependencies": [],
Expand Down
16 changes: 4 additions & 12 deletions np.Templating/src/Templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,11 @@ export async function templateQuickNote(templateTitle: string = ''): Promise<voi

await Editor.openNoteByFilename(filename)

const lines = finalRenderedData.split('\n')
const startBlock = lines.indexOf('--')
const endBlock = startBlock === 0 ? lines.indexOf('--', startBlock + 1) : -1
const renderedTemplateHasFM = hasFrontMatter(finalRenderedData)

if (startBlock >= 0 && endBlock >= 0) {
lines[startBlock] = '---'
lines[endBlock] = '---'
const newContent = lines.join('\n')
Editor.content = newContent
logDebug(
pluginJson,
`TemplateDELETME templateQuickNote: ${filename} has note sub-frontmatter, so we replaced the existing content with the rendered frontmatter; note content is now: ${newContent}`,
)
if (renderedTemplateHasFM) {
Editor.content = finalRenderedData
updateFrontMatterVars(Editor, { title: newNoteTitle })
} else {
Editor.content = `# ${newNoteTitle}\n${finalRenderedData}`
}
Expand Down
Loading