This commit is contained in:
yuin 2019-11-24 20:17:02 +09:00
parent 9dec7e9e8b
commit fba5de7344

View file

@ -119,10 +119,13 @@ var linkBottom = NewContextKey()
func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node {
line, segment := block.PeekLine() line, segment := block.PeekLine()
if line[0] == '!' && len(line) > 1 && line[1] == '[' { if line[0] == '!' {
block.Advance(1) if len(line) > 1 && line[1] == '[' {
pc.Set(linkBottom, pc.LastDelimiter()) block.Advance(1)
return processLinkLabelOpen(block, segment.Start+1, true, pc) pc.Set(linkBottom, pc.LastDelimiter())
return processLinkLabelOpen(block, segment.Start+1, true, pc)
}
return nil
} }
if line[0] == '[' { if line[0] == '[' {
pc.Set(linkBottom, pc.LastDelimiter()) pc.Set(linkBottom, pc.LastDelimiter())