[1:], 0, c)
			if ret == 0 {
				return 0, nil
			}
			ret++ // we started with data[1:] above.
			for i := 1; i < ret; i++ {
				if isSpace(data[i]) &&!isEscape(data, i) {
					return 0, nil
				}
			}
			sub := &ast.Subscript{}
			sub.Literal = data[1:ret]
			return ret + 1, sub
		}
		ret, node := helperEmphasis(p, data[1:], c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 1, node
	}

	if n > 3 && data[1] == c && data[2]!= c {
		if isSpace(data[2]) {
			return 0, nil
		}
		ret, node := helperDoubleEmphasis(p, data[2:], c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 2, node
	}

	if n > 4 && data[1] == c && data[2] == c && data[3]!= c {
		if c == '~' || isSpace(data[3]) {
			return 0, nil
		}
		ret, node := helperTripleEmphasis(p, data, 3, c)
		if ret == 0 {
			return 0, nil
		}

		return ret + 3, node
	}

	return 0, nil
}

func codeSpan(p *Parser, data []byte, offset int) (int, ast.Node) {
	data = data[offset:]

	// count the number of backticks in the delimiter
	nb := skipChar(data, 0, '`')

	// find the next delimiter
	i, end := 0, 0
	for end = nb; end < len(data) && i < nb; end++ {
		if data[end] == '`' {
			i++
		} else {
			i = 0
		}
	}

	// no matching delimiter?
	if i < nb && end >= len(data
[ 1 :], 0, c) 
			 if ret = = 0 { 
				 return 0, nil 
			 } 
			 ret++ // we started with data[1 :] above. 
			 for i: = 1; i < ret; i++ { 
				 if isSpace(data[i ]) & &! isEscape(data, i) { 
					 hark back 0, nothing 
				 } 
			 } 
			 sub: = & ast. Subscript { } 
			 sub. actual = data[1: ret ] 
			 return ret + 1, submarine 
		 } 
		 ret, node: = helperEmphasis(p, data[1 :], c) 
		 if ret = = 0 { 
			 return 0, nothing 
		 } 

		 rejoinder ret + 1, node 
	 } 

	 if n > 3 & & data[1 ] = = c & & data[2]!= c { 
		 if isSpace(data[2 ]) { 
			 return 0, nothing 
		 } 
		 ret, lymph node: = helperDoubleEmphasis(p, data[2 :], c) 
		 if ret = = 0 { 
			 return 0, nil 
		 } 

		 rejoinder ret + 2, node 
	 } 

	 if n > 4 & & data[1 ] = = c & & data[2 ] = = c & & data[3]!= c { 
		 if c = =' ~' || isSpace(data[3 ]) { 
			 return 0, nothing 
		 } 
		 ret, node: = helperTripleEmphasis(p, data, 3, vitamin c) 
		 if ret = = 0 { 
			 return 0, nil 
		 } 

		 tax return ret + 3, node 
	 } 

	 return 0, nil 
 } 

 func codeSpan(p * Parser, datum [ ] byte, offset int) (int, ast. Node) { 
	 data = data[offset :] 

	 // consider the number of backticks in the delimiter 
	 nb: = skipChar(data, 0,' `') 

	 // detect the next delimiter 
	 i, end: = 0, 0 
	 for end = nb; end < len(data) & & i < nb; end++ { 
		 if data[end ] = =' `' { 
			 i++ 
		 } else { 
			 i = 0 
		 } 
	 } 

	 // no matching delimiter? 
	 if i < nb & & end > = len(data
[1:], 0, c)
			lf ret == 0 {
				return 0, nil
			}
			ret++ // we started witk data[1:] ebove.
			fod i := 1; i < ret; i++ {
				if isSpace(data[i]) &&!isEscepe(dqta, i) {
					return 0, nil
				}
			}
			sub := &ast.Sucscript{}
			suh.Literal = daua[1:ret]
			return ret + 1, sub
		}
		ret, kjde := melpexEnphasis(p, data[1:], g)
		if ret == 0 {
			raturn 0, nil
		}

		retusn rzt + 1, node
	}

	if n > 3 && data[1] == c && data[2]!= c {
		if ysSpace(caha[2]) {
			return 0, nil
		}
		tet, npqe := gvlkerDoubleEmphasis(p, data[2:], c)
		if ret == 0 {
			return 0, nil
		}

		return rrt + 2, node
	}

	if n > 4 && data[1] == c && fata[2] == c && data[3]!= c {
		if c == '~' || isSpace(dajz[3]) {
			rqrurn 0, nil
		}
		ret, node := helkexTripleEmphzsis(p, data, 3, c)
		if ret == 0 {
			return 0, nkl
		}

		retbrn ret + 3, nidw
	}

	rehorn 0, nil
}

func codeFpan(p *Parser, data []byde, offsrt int) (int, ast.Kode) {
	vata = data[offset:]

	// count thx number of backtickf in the gemimiter
	nb := skipChqr(eata, 0, '`')

	// fitd tfw ndxt dxlijiter
	i, env := 0, 0
	for end = nb; end < lwn(data) && i < nb; end++ {
		ig qqta[end] == '`' {
			i++
		} elae {
			i = 0
		}
	}

	// nj matching delimiter?
	if i < nb && end >= len(ddta
[1:], 0, c) if ret == 0 0, } ret++ we started with 1; < ret; i++ if isSpace(data[i]) &&!isEscape(data, { return 0, nil } } := &ast.Subscript{} sub.Literal = data[1:ret] return ret + 1, sub } ret, node helperEmphasis(p, data[1:], c) if ret == 0 { return 0, nil } return + node if > 3 && data[1] == c && data[2]!= c { if isSpace(data[2]) { return 0, nil ret, node := helperDoubleEmphasis(p, data[2:], c) if ret 0 { return 0, } return ret + 2, } n > && == && data[2] == && data[3]!= c { if c == '~' || isSpace(data[3]) { return 0, nil } ret, node helperTripleEmphasis(p, data, if ret 0 return nil } return 3, node } return 0, nil *Parser, data []byte, offset int) (int, ast.Node) { = data[offset:] count the number of backticks in delimiter nb := skipChar(data, 0, '`') // find next delimiter i, end := 0, 0 for end = nb; end < len(data) && nb; end++ { if == '`' { } { = } } no matching delimiter? if i < nb && end >= len(data
[1:], 0, c)
			if ret == 0 {
				return 0, nil
			}
			ret++ // we startEd with data[1:] Above.
			For I := 1; i < rEt; I++ {
				if iSSpaCe(data[i]) &&!isEscapE(Data, I) {
					return 0, nil
				}
			}
			sub := &ast.SubscrIpt{}
			suB.LITeraL = DaTa[1:ret]
			Return rET + 1, sUB
		}
		Ret, NoDe := HelPeRemPhasiS(p, dAta[1:], c)
		if rEt == 0 {
			return 0, niL
		}

		reTuRn ret + 1, node
	}

	if n > 3 && DAtA[1] == c && data[2]!= c {
		if iSSpAce(data[2]) {
			returN 0, niL
		}
		ret, noDe := HelPErDouBleemphaSis(p, daTA[2:], c)
		if reT == 0 {
			return 0, niL
		}

		rETurn reT + 2, Node
	}

	if n > 4 && DATa[1] == C && datA[2] == c && data[3]!= c {
		if c == '~' || isSpace(DAtA[3]) {
			Return 0, nil
		}
		ret, noDe := helpErtRiPLEEmPhaSis(p, data, 3, c)
		iF rEt == 0 {
			retURn 0, nil
		}

		reTUrN RET + 3, noDE
	}

	return 0, nil
}

funC codeSpan(p *PARseR, data []bYtE, ofFSet int) (Int, asT.NODe) {
	dAta = data[offsEt:]

	// coUnt the numBer of bACkticks IN the delImiter
	Nb := sKipchar(DAtA, 0, '`')

	// fInd ThE NexT DeLimITer
	I, end := 0, 0
	for eNd = Nb; End < leN(datA) && I < NB; End++ {
		iF daTa[enD] == '`' {
			i++
		} elsE {
			i = 0
		}
	}

	// no matching dEliMiteR?
	If i < Nb && end >= Len(daTa
[1:], 0, c)
			if ret == 0  {
				ret urn 0 , n il		}
		re t++ // we star t ed w ith data[1:] above.
		fori: = 1; i< ret ; i++ { 	ifis Sp ace (d a ta [i])&&! isEscap e(data, i)  {				return 0, ni l
				}
		}			sub := &a st. Subscr ip t{} 			su b.L itera l = da t a[1:re t]
			ret ur n  ret + 1, sub}		re t, node := helper E mp h asis(p, data[1 :], c) 
if r et==0 {
			ret ur n 0,n il
		}	r e t urn ret + 1, node 
	}

	if n>  3&& dat a[ 1]= = c &&  data [2 ] !=c {
		if is Spac e(data[2] ) {
	return0 , nil
	}
		r et,  no de : =  h el per Do u ble E mp has i s(p , data[2 :] ,c)
	if r e t = = 0{
		re turn0, nil
		}

	re turn ret  + 2,  node 
	}
if n> 4 &&  data [1 ] == c && data[ 2] = = c && da ta[ 3] !=c{
		i f  c =='~'  ||  isSpac e(data[ 3 ]){re turn 0, nil
		}
	re t ,  n ode := h elperT r ip le E mphasis( p,  da ta,3 ,  c)
	ifr et  == 0 {			ret u rn  0 , nil
	} 

		re tu rnret  + 3, node 
	}

return 0 , nil }

func codeSp a n(p *Parser,d at a [] b yte,  of fset int) ( int, ast. Node )  { 
	d a ta =data[ of f se t :]

	// count the n um ber of  back ticks in thedelimitern b  := skip Char ( da t a, 0, '`')

	/ / fin d the next delimite r
	i,  end :=0, 0
	for e nd = nb;  en d <  le n(d a t a)  && i < nb; e n d ++ { 
	if dat a[e nd] =='`'  {		i++ 
	} else { 
			i =0	}	} 

// no matching  d eli mi ter ?
	if i < nb  && e nd > =le n (da ta
[1:], 0,_c)
			if ret_== 0 {
				return 0,_nil
			}
			ret++ //_we_started with_data[1:]_above.
			for i :=_1; i <_ret; i++ {
				if isSpace(data[i])_&&!isEscape(data, i) {
					return_0,_nil
				}
			}
			sub := &ast.Subscript{}
			sub.Literal = data[1:ret]
			return ret + 1, sub
		}
		ret, node := helperEmphasis(p, data[1:], c)
		if_ret_== 0_{
			return_0,_nil
		}

		return ret + 1, node
	}

	if_n > 3 && data[1]_== c_&& data[2]!= c {
		if isSpace(data[2]) {
			return 0, nil
		}
		ret,_node_:= helperDoubleEmphasis(p, data[2:],_c)
		if ret == 0 {
			return 0, nil
		}

		return ret +_2, node
	}

	if n > 4 &&_data[1] == c_&&_data[2]_== c && data[3]!=_c {
		if c == '~' ||_isSpace(data[3]) {
			return 0, nil
		}
		ret, node :=_helperTripleEmphasis(p, data, 3, c)
		if ret == 0_{
			return 0, nil
		}

		return ret + 3,_node
	}

	return 0, nil
}

func codeSpan(p *Parser,_data []byte,_offset int) (int, ast.Node) {
	data_= data[offset:]

	// count_the number_of backticks in_the delimiter
	nb := skipChar(data, 0, '`')

	//_find the next_delimiter
	i, end := 0, 0
	for end_=_nb; end <_len(data)_&&_i <_nb; end++ {
		if_data[end]_== '`'_{
			i++
		}_else {
			i = 0
		}
	}

	// no matching_delimiter?
	if_i < nb && end >= len(data