chore: fix horizontal rule matcher

pull/2723/head
Steven 1 year ago
parent 5449342016
commit 32d02ba022

@ -26,11 +26,8 @@ func (*HorizontalRuleParser) Match(tokens []*tokenizer.Token) (int, bool) {
if len(tokens) > 3 && tokens[3].Type != tokenizer.Newline { if len(tokens) > 3 && tokens[3].Type != tokenizer.Newline {
return 0, false return 0, false
} }
if len(tokens) == 3 {
return 3, true return 3, true
} }
return 4, true
}
func (p *HorizontalRuleParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { func (p *HorizontalRuleParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
size, ok := p.Match(tokens) size, ok := p.Match(tokens)

Loading…
Cancel
Save