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

View file

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