Skip to content

Commit

Permalink
chore: update code matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Feb 28, 2024
1 parent 75b2b15 commit 6a73bfa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parser/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ func (*CodeParser) Match(tokens []*tokenizer.Token) (ast.Node, int) {
return nil, 0
}
matchedTokens = matchedTokens[:1+nextBacktickIndex+1]
contentTokens := matchedTokens[1 : len(matchedTokens)-1]
if len(contentTokens) == 0 {
return nil, 0
}
return &ast.Code{
Content: tokenizer.Stringify(matchedTokens[1 : len(matchedTokens)-1]),
Content: tokenizer.Stringify(contentTokens),
}, len(matchedTokens)
}

0 comments on commit 6a73bfa

Please sign in to comment.