foam icon indicating copy to clipboard operation
foam copied to clipboard

Fix parsing of tags when colon exists in other properties

Open daniellowtw opened this issue 8 months ago • 2 comments

The parsing of tags relies splitting on colon which does not work when other properties has colon. E.g. having a date property that includes time.

This commit fixes it by rewriting the logic to get tags -> line number.

Previously, having frontmatter like

---
title: 2025 04 11
date: 2025-04-11T00:01:00+01:00
tags: 
    - new
---

causes the parser to silently error out and therefore doesn't parse the tags defined in the yaml at all.

daniellowtw avatar Apr 11 '25 06:04 daniellowtw

Thanks @daniellowtw - given the work in #1482 which completely changes the way we parse markdown, I will wait to merge this PR. Maybe @ryanncode can add your test case to the PR to make sure colons are properly handled

riccardoferretti avatar Aug 12 '25 17:08 riccardoferretti

Thanks. I look forward to having this fixed so I don't have to run my own branch anymore :)

daniellowtw avatar Aug 14 '25 20:08 daniellowtw