Skip to content

bug: obsidian style tags false positive #224

@neo451

Description

@neo451

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.26.3

Describe the bug

forms like https://neovim.io#docs will be falsely parsed as tags

tags should only be parsed at with a whitespace before it or at the start of the line.

Steps To Reproduce/Bad Parse Tree

  1. a file with https://example.com/#/settings#privacy
  2. tree:
(document ; [0, 0] - [1, 0]
  (section ; [0, 0] - [1, 0]
    (paragraph ; [0, 0] - [1, 0]
      (inline ; [0, 0] - [0, 38]
        (inline ; [0, 0] - [0, 38]
          (tag) ; [0, 20] - [0, 30]
          (tag)))))) ; [0, 30] - [0, 38]

Expected Behavior/Parse Tree

(document ; [0, 0] - [1, 0]
  (section ; [0, 0] - [1, 0]
    (paragraph ; [0, 0] - [1, 0]
      (inline ; [0, 0] - [0, 38]
        (inline))))) ; [0, 30] - [0, 38]

Repro

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions