Skip to content

Strip YAML quotes from frontmatter tags - #343

Merged
gamosoft merged 1 commit into
gamosoft:mainfrom
jayhemnani9910:fix/quoted-frontmatter-tags
Nov 14, 2026
Merged

gamosoft merged 1 commit into
gamosoft:mainfrom
jayhemnani9910:fix/quoted-frontmatter-tags

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

Quoted tag values keep their quotes, so the same tag shows up twice and the tag filter misses notes:

Kickoff.md:  tags: ["meeting", "project-x"]
Standup.md:  tags: [meeting]

GET /api/tags gave {"\"meeting\"": 1, "\"project-x\"": 1, "meeting": 1} and GET /api/tags/meeting returned only Standup. YAML needs quotes for values like "2026" and many tools write them for every value, so this is common when bringing in an existing vault.

parse_tags now drops one pair of matching " or ' from each tag, in the inline list, single value and block list forms, and so does parseTagsFromContent in frontend/app.js, which sets a note's tags right after it is created or saved. With the change the same two notes give {"meeting": 2, "project-x": 1}, and the meeting filter returns both.

Tested by running the server locally with a fresh notes folder, creating the two notes through the API and reading the tags back, before and after, plus parse_tags on block lists and a single quoted value (tags: 'work' -> work).

tags: ["meeting"] and tags: [meeting] were two different tags, so the
quoted one was missing from the tag filter. YAML needs quotes for
values like "2026", and many tools write them anyway. Drop one pair
of matching quotes from each tag, in the backend parser and in the
frontend copy used right after a save.
@gamosoft
gamosoft merged commit d477a18 into gamosoft:main Nov 14, 2026
@gamosoft

Copy link
Copy Markdown
Owner

Nice, thanks again @jayhemnani9910 !!! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants