Skip to content

YAML parsing error when inserting template #1708

@Yodo9000

Description

@Yodo9000

Plugin information

  • OS: Windows 10
  • Templater version: 2.18.1
  • Obsidian version: 1.12.4
  • Trigger Templater on new file creation:
    • Apply the following template:
      ---
      aliases:
      - %
      ---
      

Describe the bug
The newly created file remains empty. The console shows the following:

app.js:1 Uncaught (in promise) YAMLParseError: Plain value cannot start with directive indicator character % at line 2, column 3:

- %
  ^

    at onError (app.js:1:1277524)
    at c (app.js:1:1269939)
    at app.js:1:1270259
    at US (app.js:1:1270333)
    at YS (app.js:1:1272698)
    at $S (app.js:1:1274871)
    at app.js:1:1263551
    at qS (app.js:1:1263682)
    at app.js:1:1275452
    at $S (app.js:1:1275996)

Expected behavior
The template to be inserted into the file, even if the YAML is incorrect - the core Template plugin does do this.

Additional context

Initially my template was the following:

---
aliases:
- %% unsure if to add aliases %%
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions