Fix index out of range in headline priority parsing
fuzzed - counting is hard...
This commit is contained in:
parent
20970ec872
commit
f69b043136
4 changed files with 28 additions and 3 deletions
|
@ -56,7 +56,7 @@ func (d *Document) parseHeadline(i int, parentStop stopFn) (int, Node) {
|
|||
}
|
||||
}
|
||||
|
||||
if len(text) >= 3 && text[0:2] == "[#" && strings.Contains("ABC", text[2:3]) && text[3] == ']' {
|
||||
if len(text) >= 4 && text[0:2] == "[#" && strings.Contains("ABC", text[2:3]) && text[3] == ']' {
|
||||
headline.Priority = text[2:3]
|
||||
text = strings.TrimSpace(text[4:])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue