Require a space after : for definition list

This commit is contained in:
LI Tao 2019-07-15 15:18:07 +08:00
parent 032792ae55
commit 9313a1c188

View file

@ -105,7 +105,7 @@ func NewDefinitionDescriptionParser() parser.BlockParser {
func (b *definitionDescriptionParser) Open(parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) {
line, _ := reader.PeekLine()
pos := pc.BlockOffset()
if line[pos] != ':' {
if line[pos] != ':' || len(line) <= pos || line[pos+1] != ' ' {
return nil, parser.NoChildren
}
list, _ := parent.(*ast.DefinitionList)