Wiki Links and Backlinks produce repeated keys in YAML front matter

I’ve been testing out Notenik by importing small folders of notes from other apps, and I’ve encountered a bug in how Notenik populates inbound and outbound links (“Backlinks” and “Wiki Links”) in YAML front matter. The YAML that Notenik produces for these keys is invalid.

For example, let’s say that I have a note named “addition” that:

  1. refers to [[addend]], [[subtraction]], and [[sum]], and
  2. is referred to by [[multiplication]] and [[subtraction]].

If Notenik produces YAML front matter for “addition” like so:

---
Title: addition
Date Added: 2026-04-19 17:06:44 -0400
Date Modified: 2026-04-19 17:25:04 -0400
Backlinks: multiplication
Backlinks: subtraction
Wiki Links: addend
Wiki Links: subtraction
Wiki Links: sum
---

According to Claude, the above is not valid YAML, and YAML parsers (other than Notenik’s) will produce undesirable results:

Short answer: it’s undefined behavior — the YAML spec says duplicate keys are invalid, but parsers handle it inconsistently.

What the YAML spec says

Duplicate keys are explicitly a mapping error per the spec. Compliant parsers should reject them, but most don’t.

What actually happens in practice

Different parsers have different behaviors — and the behavior that matters depends on what’s consuming your frontmatter.

The overwhelmingly common real-world behavior is last key wins, silently, with no warning.

The practical takeaway

  • Don’t rely on any particular behavior — it’s fragile and parser-dependent

  • Linters like yamllint will flag duplicate keys if you want to catch them early

  • If you’re scripting against your notes (e.g. with Python), PyYAML will silently drop earlier duplicates, which can cause subtle bugs

Correct YAML for the above example would be:

---
Title: addition
Date Added: 2026-04-19 17:06:44 -0400
Date Modified: 2026-04-19 17:25:04 -0400
Backlinks:
  - multiplication
  - subtraction
Wiki Links:
  - addend
  - subtraction
  - sum
---

Even nicer than the above would be YAML front matter that is compatible with the YAML ingested and produced by other applications. Example YAML for that case would be:

---
Title: addition
Date Added: 2026-04-19 17:06:44 -0400
Date Modified: 2026-04-19 17:25:04 -0400
Backlinks:
  - '[[multiplication]]'
  - '[[subtraction]]'
Wiki Links:
  - '[[addend]]'
  - '[[subtraction]]'
  - '[[sum]]'
---

I realize that this last example would be a new feature rather than a bug fix, but I do think making Notenik’s YAML more compatible with Obsidian, Octarine, Capacities, etc., would be useful.

1 Like

Well, first of all, thanks for giving Notenik a spin! And thanks for joining our forum! And thanks as well for reporting the issue!

Let me look into this and see what I can do.

1 Like

Try this latest beta and let me know how this works for you.

That works! Thank you!

Great! Glad to hear it! Let me know if you run into any other issues.