Skip to content

Commit

Permalink
chore: update tag matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Sep 17, 2024
1 parent b5c4d4d commit e4c4c45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parser/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (*TagParser) Match(tokens []*tokenizer.Token) (ast.Node, int) {

contentTokens := []*tokenizer.Token{}
for _, token := range matchedTokens[1:] {
if token.Type == tokenizer.Space || token.Type == tokenizer.PoundSign {
if token.Type == tokenizer.Space || token.Type == tokenizer.PoundSign || token.Type == tokenizer.Backslash {
break
}
contentTokens = append(contentTokens, token)
Expand Down
6 changes: 6 additions & 0 deletions parser/tests/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ func TestTagParser(t *testing.T) {
Content: "tag/subtag",
},
},
{
text: `#tag\'s 123`,
node: &ast.Tag{
Content: "tag",
},
},
}

for _, test := range tests {
Expand Down

2 comments on commit e4c4c45

@RoccoSmit
Copy link

@RoccoSmit RoccoSmit commented on e4c4c45 Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The \ ends the tag as expected but is also included in the UI

image

@boojack
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoccoSmit Updated with b2451d1

Please sign in to comment.