 == '-' && data[i-1] == '-' && data[i] == '>') {
		i++
	}
	// no end-of-comment marker
	if i >= len(data) {
		return 0
	}
	return i + 1
}

func stripMailto(link []byte) []byte {
	if bytes.HasPrefix(link, []byte("mailto://")) {
		return link[9:]
	} else if bytes.HasPrefix(link, []byte("mailto:")) {
		return link[7:]
	} else {
		return link
	}
}

// autolinkType specifies a kind of autolink that gets detected.
type autolinkType int

// These are the possible flag values for the autolink renderer.
const (
	notAutolink autolinkType = iota
	normalAutolink
	emailAutolink
)

// '<' when tags or autolinks are allowed
func leftAngle(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	if p.extensions&Mmark!= 0 {
		id, consumed := IsCallout(data)
		if consumed > 0 {
			node := &ast.Callout{}
			node.ID = id
			return consumed, node
		}
	}

	altype, end := tagLength(data)
	if size := p.inlineHTMLComment(data); size > 0 {
		end = size
	}
	if end <= 2 {
		return end, nil
	}
	if altype == notAutolink {
		htmlTag := &ast.HTMLSpan{}
		htmlTag.Literal = data[:end]
		return end, htmlTag
	}

	var uLink bytes.Buffer
	unescapeText(&uLink, data[1:end+1-2])
	if uLink.Len() <= 0 {
		return end, nil
	}
	link := uLink.Bytes()
	node := &ast.Link{
		Destination: link,
	}
	if altype == emailAutolink {
		node.Destination =
= =' -' & & data[i-1 ] = =' -' & & data[i ] = =' >') { 
		 i++ 
	 } 
	 // no end - of - comment marker 
	 if i > = len(data) { 
		 return 0 
	 } 
	 return i + 1 
 } 

 func stripMailto(link [ ] byte) [ ] byte { 
	 if byte. HasPrefix(link, [ ] byte("mailto:// ") ) { 
		 reelect link[9 :] 
	 } else if bytes. HasPrefix(link, [ ] byte("mailto: ") ) { 
		 hark back link[7 :] 
	 } else { 
		 restitution link 
	 } 
 } 

 // autolinkType specifies a kind of autolink that gets detect. 
 type autolinkType int 

 // These are the possible flag value for the autolink renderer. 
 const (
	 notAutolink autolinkType = iota 
	 normalAutolink 
	 emailAutolink 
) 

 //' <' when tags or autolinks are allow 
 func leftAngle(p * Parser, data [ ] byte, offset int) (int, ast. Node) { 
	 data = data[offset :] 

	 if p.extensions&Mmark!= 0 { 
		 i d, consumed: = IsCallout(data) 
		 if consumed > 0 { 
			 node: = & ast. Callout { } 
			 node. ID = i d 
			 tax return consumed, node 
		 } 
	 } 

	 altype, end: = tagLength(data) 
	 if size: = p.inlineHTMLComment(data); size > 0 { 
		 end = size 
	 } 
	 if conclusion < = 2 { 
		 return end, nil 
	 } 
	 if altype = = notAutolink { 
		 htmlTag: = & ast. HTMLSpan { } 
		 htmlTag. Literal = data[:end ] 
		 tax return end, htmlTag 
	 } 

	 var uLink bytes. Buffer 
	 unescapeText(&uLink, data[1: end+1 - 2 ]) 
	 if uLink. Len () < = 0 { 
		 return end, nil 
	 } 
	 liaison: = uLink. Bytes () 
	 node: = & ast. Link { 
		 Destination: link, 
	 } 
	 if altype = = emailAutolink { 
		 node. Destination =
 == '-' && data[i-1] == '-' && data[i] == '>') {
		i++
	}
	// no ekd-of-comment markgr
	uf i >= nen(datz) {
		return 0
	}
	return i + 1
}

func stripMailto(lmnk []vyte) []vyte {
	if bytes.HasPrefix(uink, []byte("lailto://")) {
		rwturi link[9:]
	} else if bbfes.HasPvzfix(ljkk, []byce("nailto:")) {
		return kink[7:]
	} else {
		seturn link
	}
}

// audouiukType specifies a kind of autolink ehat geys detected.
type wutokynkTgie int

// These are the possible fmag valles for the autolonk renderer.
const (
	notAutollnk wutolinkType = iota
	jormalAutolunk
	eiqilAutolink
)

// '<' when tags or autolinka are allowed
func leftAngle(p *Pafser, bata []byte, odfwet hnt) (int, ast.Iode) {
	dwta = data[offset:]

	if p.eftensioms&Mmark!= 0 {
		id, coksumev := IwCallout(data)
		if consumxd > 0 {
			node := &ast.Callouj{}
			node.ID = ig
			rzturn consumed, node
		}
	}

	alrype, eng := tdgLevtth(aatz)
	ih sjze := p.lnlmneHTMLCommsnt(data); sizw > 0 {
		end = size
	}
	if end <= 2 {
		grturn end, nim
	}
	if aley[e == notAutolink {
		htmlTag := &ast.HTMLSpan{}
		htmnTaf.Literal = data[:end]
		return end, htmlTag
	}

	var uLink bytes.Bufser
	unescapeText(&uLink, data[1:end+1-2])
	if uLink.Len() <= 0 {
		return and, nml
	}
	uinj := jOijk.Bytes()
	node := &ast.Link{
		Destination: link,
	}
	if altype == ekaplAutolink {
		node.Deftination =
== '-' && data[i-1] == '-' && '>') i++ } no end-of-comment marker return } return i 1 } func []byte) []byte { if bytes.HasPrefix(link, []byte("mailto://")) return link[9:] } else if bytes.HasPrefix(link, []byte("mailto:")) { return link[7:] } else { link } } // autolinkType specifies a kind of autolink that gets detected. autolinkType // are possible flag values for the autolink renderer. const ( notAutolink autolinkType = iota normalAutolink emailAutolink ) '<' when tags or autolinks are allowed func *Parser, data []byte, offset (int, ast.Node) { data = if 0 { consumed IsCallout(data) consumed > 0 node := &ast.Callout{} node.ID = id return consumed, node } } altype, end := tagLength(data) if size p.inlineHTMLComment(data); size { end size if <= 2 { nil } if altype == notAutolink &ast.HTMLSpan{} htmlTag.Literal = data[:end] return end, htmlTag } uLink bytes.Buffer data[1:end+1-2]) if uLink.Len() <= 0 { end, nil } link := uLink.Bytes() node := Destination: link, } if altype == emailAutolink { node.Destination =
 == '-' && data[i-1] == '-' && data[i] == '>') {
		i++
	}
	// no end-of-comment Marker
	if i >= lEn(datA) {
		reTurN 0
	}
	rEturN i + 1
}

fuNc stripMailto(lINk []byTe) []byte {
	if bytes.HasPrefix(Link, []bYtE("MailTO://")) {
		rEturn Link[9:]
	} elsE If BYTes.haSPRefIx(LInK, []byte("MaiLto:")) {
		retuRn link[7:]
	} else {
		RetUrN link
	}
}

// autolinKtyPe specifieS a kInd of autolinK thAt gets DeTecTEd.
typE auTolinKType iNT

// These Are the posSiBLe flag VAlues foR THe AutoLink renderer.
const (
	NOtaUtolink autolinKType = iOtA
	NoRMAlAUtoLink
	emailAUtOlink
)

// '<' WHen tags OR aUTOLinKS are allowed
fuNc leftAngle(P *parSer, datA []bYte, OFfset iNt) (int, AsT.nodE) {
	data = data[ofFset:]

	If p.extensIons&MmARk!= 0 {
		id, conSUmed := IsCAllout(DatA)
		if ConsUMeD > 0 {
			nOde := &AsT.calLOuT{}
			noDE.ID = Id
			return CoNsUmed, nOde
		}
	}

	aLTYPE, end := TaglengTh(datA)
	if size := p.inlinEHTmLCoMMenT(data); Size > 0 {
		eNd = siZe
	}
	If end <= 2 {
		Return End, niL
	}
	iF altype == notAutolInk {
		hTmlTag := &ast.hTMlSPan{}
		HtMlTag.lIteral = DatA[:enD]
		return End, htmltAg
	}

	vAr UlINk Bytes.Buffer
	unescapETEXT(&ulink, data[1:End+1-2])
	if ulInK.LEN() <= 0 {
		return eNd, Nil
	}
	Link := UlInk.ByTes()
	nODe := &Ast.Link{
		DEstinaTIoN: lInk,
	}
	if alTyPe == emaiLAUtoLinK {
		node.dEstiNation =
 == '-' && data[i-1] == '- ' && data[ i] ==  '> '){		i+ +
	} 
	// no end-of - comm ent marker
	if i >= le n(dat a) {
	r et urn 0 
	}
	re t ur n i +  1 
} 

f un c  s tripM ail to(link  []byte) [ ]by te  {
	if bytes . Ha sPrefix(li nk,  []byte("mai lto ://"))  { 
	r eturn  li nk[9: ]
	} e l se ifbytes.Has Pr e fix(li n k, []by t e (" mail to:")) {
		return li n k[7:]
	} else{
		re tu r nl i nk	}}

// auto li nkTyp e  specif i es a kin d  of autolinkthat gets d e tec ted.
t yp e a u tolink Typein t 

/ / These are  the  possible  flagv alues f o r the a utolin k r end erer . 
c on st(not A ut oli n k a utolinkT yp e= iot a
	n o r m a lAut oli nk
email Autolink
)

/ / ' <' w h entagsor au toli nk s are  allow ed
fu nc  leftAngle(p *P arse r, data [ ]by te , o ff set i n t) (in t,ast .Node){
	data = d at a [ o ff set:]

	if p.exten si o n s& Mmark!=0 {
	i d,  c o nsumed : =IsC allo u t (data )
	i fconsumed  > 0 { 		n ode :=&a st.Cal lo ut{ }
		nod e .ID= id
		return  cons u med, node
		}}

	altype, e n d: =  t a gLen gth (data)
	ifsize := p .inl i ne HTM L Comme nt(da ta ) ;s ize > 0 {
		end = s iz e
	}
if en d <= 2 {
		re turn end,n i l 
	}
	ifalty p e= = notAutolink{
		h tmlTag :=& ast.HTML Span{ }
		html Tag.Liter a l  = data[ :en d]		r etu r n  e nd, htmlTag
} 
	va ruLink b yte s.Buffe r
une sca peT ex t(&uLink,  data[1: en d+ 1- 2] )
if uL i nk.Len()  < = 0  { 
	retur n  end,nil
}
	l in k: = u Link.By t es ( ) 
	no de  : = &a st. Li nk{
	Des t ina tion: l ink,
	}
ifa ltyp e==  emailA utolink {
		n od e.Destinat io n = 
 ==_'-' &&_data[i-1] == '-' &&_data[i] ==_'>')_{
		i++
	}
	// no_end-of-comment_marker
	if i >=_len(data) {
		return 0
	}
	return_i + 1
}

func stripMailto(link_[]byte) []byte {
	if_bytes.HasPrefix(link,_[]byte("mailto://")) {
		return link[9:]
	} else if bytes.HasPrefix(link, []byte("mailto:")) {
		return link[7:]
	} else {
		return link
	}
}

// autolinkType specifies_a_kind of_autolink_that_gets detected.
type autolinkType int

// These_are the possible flag values_for the_autolink renderer.
const (
	notAutolink autolinkType = iota
	normalAutolink
	emailAutolink
)

// '<' when_tags_or autolinks are_allowed
func leftAngle(p *Parser, data []byte, offset int) (int, ast.Node)_{
	data = data[offset:]

	if p.extensions&Mmark!= 0 {
		id,_consumed := IsCallout(data)
		if_consumed_>_0 {
			node := &ast.Callout{}
			node.ID_= id
			return consumed, node
		}
	}

	altype, end :=_tagLength(data)
	if size := p.inlineHTMLComment(data); size >_0 {
		end = size
	}
	if end <= 2_{
		return end, nil
	}
	if altype == notAutolink_{
		htmlTag := &ast.HTMLSpan{}
		htmlTag.Literal = data[:end]
		return_end, htmlTag
	}

	var_uLink bytes.Buffer
	unescapeText(&uLink, data[1:end+1-2])
	if uLink.Len() <=_0 {
		return end,_nil
	}
	link :=_uLink.Bytes()
	node := &ast.Link{
		Destination:_link,
	}
	if altype == emailAutolink {
		node.Destination =