From fba5de7344cd2fcbb94a43844f5e1f94ab4ce55a Mon Sep 17 00:00:00 2001 From: yuin Date: Sun, 24 Nov 2019 20:17:02 +0900 Subject: [PATCH] Fixes #34 --- parser/link.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parser/link.go b/parser/link.go index bdefc81..6326585 100644 --- a/parser/link.go +++ b/parser/link.go @@ -119,10 +119,13 @@ 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] == '[' { - block.Advance(1) - pc.Set(linkBottom, pc.LastDelimiter()) - return processLinkLabelOpen(block, segment.Start+1, true, pc) + 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())