mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fixes #34
This commit is contained in:
parent
9dec7e9e8b
commit
fba5de7344
1 changed files with 7 additions and 4 deletions
|
|
@ -119,11 +119,14 @@ 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] == '!' {
|
||||||
|
if len(line) > 1 && line[1] == '[' {
|
||||||
block.Advance(1)
|
block.Advance(1)
|
||||||
pc.Set(linkBottom, pc.LastDelimiter())
|
pc.Set(linkBottom, pc.LastDelimiter())
|
||||||
return processLinkLabelOpen(block, segment.Start+1, true, pc)
|
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())
|
||||||
return processLinkLabelOpen(block, segment.Start, false, pc)
|
return processLinkLabelOpen(block, segment.Start, false, pc)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue