mdelobelle / obsidian_supercharged_links

obsidian plugin to add attributes and context menu options to internal links
MIT License
501 stars 33 forks source link

Tag-styles incorrectly match substrings, like nested tags #226

Open stracker-phil opened 4 months ago

stracker-phil commented 4 months ago

Short: The tag condition matches any note that contains the mentioned tag anywhere in its tag list, disregarding nested tags or substrings.

Sample:

Create two sample notes:

Expected: The above sample should not style the sample notes. They do not contain the tag "#Company" (rather, they contain "#Finances" and "#CompanyBills")

Actual: The current CSS logic targets all notes that contain the text "company" somewhere in the tags field.

Suggestion

.data-link-icon[data-link-tags*="#Company " i]::before, /* e.g. "#Company #Client" */
.data-link-icon[data-link-tags*="#Company/" i]::before, /* e.g. "#Company/Client" */
.data-link-icon[data-link-tags$="#Company" i]::before   /* e.g. "#Company" */
HEmile commented 4 months ago

Good point. I'll try this out for the next version