diff --git a/parser/inline.go b/parser/inline.go index e9b08303..d526ce22 100644 --- a/parser/inline.go +++ b/parser/inline.go @@ -271,7 +271,7 @@ func maybeInlineFootnoteOrSuper(p *Parser, data []byte, offset int) (int, ast.No // '[': parse a link or an image or a footnote or a citation func link(p *Parser, data []byte, offset int) (int, ast.Node) { // no links allowed inside regular links, footnote, and deferred footnotes - if p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') { + if p.InsideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') { return 0, nil } @@ -622,10 +622,10 @@ func link(p *Parser, data []byte, offset int) (int, ast.Node) { } else { // links cannot contain other links, so turn off link parsing // temporarily and recurse - insideLink := p.insideLink - p.insideLink = true + InsideLink := p.InsideLink + p.InsideLink = true p.Inline(link, data[1:txtE]) - p.insideLink = insideLink + p.InsideLink = InsideLink } return i, link @@ -860,7 +860,7 @@ const shortestPrefix = 6 // len("ftp://"), the shortest of the above func maybeAutoLink(p *Parser, data []byte, offset int) (int, ast.Node) { // quick check to rule out most false hits - if p.insideLink || len(data) < offset+shortestPrefix { + if p.InsideLink || len(data) < offset+shortestPrefix { return 0, nil } for _, prefix := range protocolPrefixes { diff --git a/parser/parser.go b/parser/parser.go index d2098f7b..43f21369 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -103,7 +103,7 @@ type Parser struct { inlineCallback [256]InlineParser nesting int maxNesting int - insideLink bool + InsideLink bool indexCnt int // incremented after every index // Footnotes need to be ordered as well as available to quickly check for @@ -143,7 +143,7 @@ func NewWithExtensions(extension Extensions) *Parser { refs: make(map[string]*reference), refsRecord: make(map[string]struct{}), maxNesting: 64, - insideLink: false, + InsideLink: false, Doc: &ast.Document{}, extensions: extension, allClosed: true,