html_tag.go
func (e *htmlTag) parseTokens() []string {
	var inQuote bool
	var inDelim bool
	var tokens []string
	var token string

	str := strings.Join(e.ln.tokens[1:], space)
	for _, chr := range str {
		switch c := string(chr); c {
		case space:
			if inQuote || inDelim {
				token += c
			} else {
				tokens = append(tokens, token)
				token = ""
			}
		case doubleQuote:
			if !inDelim {
				if inQuote {
					inQuote = false
				} else {
					inQuote = true
				}
			}
			token += c
		default:
			token += c
			if inDelim {
				if strings.HasSuffix(token, e.opts.DelimRight) {
					inDelim = false
				}
			} else {
				if strings.HasSuffix(token, e.opts.DelimLeft) {
					inDelim = true
				}
			}
		}
	}
	if len(token) > 0 {
		tokens = append(tokens, token)
	}
	return tokens
}
func (e *htmlTag) parseTokens() []string {
	var inQuote bool
	var inDelim bool
	var tokens []string
	var token string

	str := strings.Join(e.ln.tokens[1:], space)
	for _, chr := range str {
		switch c := string(chr); c {
		case space:
			if inQuote || inDelim {
				token += c
			} else {
				tokens = append(tokens, token)
				token = ""
			}
		case doubleQuote:
			if !inDelim {
				if inQuote {
					inQuote = false
				} else {
					inQuote = true
				}
			}
			token += c
		default:
			token += c
			if inDelim {
				if strings.HasSuffix(token, e.opts.DelimRight) {
					inDelim = false
				}
			} else {
				if strings.HasSuffix(token, e.opts.DelimLeft) {
					inDelim = true
				}
			}
		}
	}
	if len(token) > 0 {
		tokens = append(tokens, token)
	}
	return tokens
}
func ( e * htmlTag ) parseTokens ( ) [ ] string { var inQuote bool var inDelim bool var tokens [ ] string var token string str := strings . Join ( e . ln . tokens [ 1 : ] , space ) for _ , chr := range str { switch c := string ( chr ) ; c { case space : if inQuote || inDelim { token += c } else { tokens = append ( tokens , token ) token = " " } case doubleQuote : if ! inDelim { if inQuote { inQuote = false } else { inQuote = true } } token += c default : token += c if inDelim { if strings . HasSuffix ( token , e . opts . DelimRight ) { inDelim = false } } else { if strings . HasSuffix ( token , e . opts . DelimLeft ) { inDelim = true } } } } if len ( token ) > 0 { tokens = append ( tokens , token ) } return tokens }
// parseTokens parses the tokens and return them
parseTokens parses the tokens and return them