Skip to content

Filter Obsidian pseudo-tags#58

Open
fa1k3 wants to merge 1 commit into
cyanheads:mainfrom
fa1k3:fix/filter-pseudo-tags
Open

Filter Obsidian pseudo-tags#58
fa1k3 wants to merge 1 commit into
cyanheads:mainfrom
fa1k3:fix/filter-pseudo-tags

Conversation

@fa1k3
Copy link
Copy Markdown

@fa1k3 fa1k3 commented May 20, 2026

Summary

  • filter CSS color literals (#rrggbb / #rrggbbaa) out of the Local REST API /tags/ response
  • apply the filter in the service layer so obsidian_list_tags and obsidian://tags stay consistent
  • scope it narrowly to the unambiguous 6- and 8-hex form only

Why

Obsidian's tag tokenizer can report CSS color literals from prose or code as tags. Filtering the 6/8-hex form makes tag listings cleaner. Pure-numeric names and 3-hex names are deliberately not filtered — they collide with legitimate short tags (ace, bad, fed) and year tags (2024, 1984), so dropping them would be surprising data loss.

Tests

  • bun test tests/services/obsidian-pseudo-tag.test.ts
  • bun run test (full suite green)
  • bun run test:types

Note

Branch rebased onto current main. The filter is narrowed to 6/8-hex only (down from an earlier numeric + 3/6/8-hex version) after review feedback that the broader form dropped legitimate year/short tags.

Obsidian's tag tokenizer surfaces CSS color literals (#rrggbb / #rrggbbaa)
from prose and code as tags. Narrow the listTags pseudo-tag filter to the
unambiguous 6- and 8-hex form only. Pure-numeric and 3-hex names are no
longer filtered — they collide with legitimate short tags (ace, bad, fed)
and year tags (2024, 1984).

Branch rebased onto current main; adds a focused unit test for
isObsidianPseudoTag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@fa1k3 fa1k3 force-pushed the fix/filter-pseudo-tags branch from a5763f3 to 0a812b5 Compare June 2, 2026 12:52
@fa1k3
Copy link
Copy Markdown
Author

fa1k3 commented Jun 2, 2026

Updated: rebased onto current main and narrowed the filter to the 6/8-hex form only. The earlier numeric + 3-hex cases were dropped because they ate legitimate year tags (#2024, #1984) and short words that happen to be valid hex (#ace, #bad, #fed). Full suite green, types clean. Ready for review.

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.

1 participant