Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stracker-phil opened this issue Apr 15, 2024 · 1 comment
Open

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

stracker-phil opened this issue Apr 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@stracker-phil
Copy link

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

Sample:

  • Add styling rule: Note has tag "#Company"

Create two sample notes:

  • Note 1 with nested tag: #Finances/company/bank_usd
  • Note 2 with tag: #CompanyBills

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

  • Currently, the styling CSS uses .data-link-icon[data-link-tags*="Company" i]::before to recognize "#Company" tags.
  • More accurate would be .data-link-icon[data-link-tags*="#Company" i]::before (to skip nested tags)
  • The most accurate CSS would be:
.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
Copy link
Collaborator

HEmile commented Apr 15, 2024

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

@HEmile HEmile self-assigned this Apr 15, 2024
@HEmile HEmile added the bug Something isn't working label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants