mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
parent
c4bec47e7d
commit
e27f19c12f
@ -77,7 +77,15 @@ func (d *httpBodyContentTyper) Tokenise(options *TokeniseOptions, text string) (
|
||||
}
|
||||
|
||||
return func() Token {
|
||||
for token := it(); token != EOF; token = it() {
|
||||
token := it()
|
||||
|
||||
if token == EOF {
|
||||
if subIterator != nil {
|
||||
return subIterator()
|
||||
}
|
||||
return EOF
|
||||
}
|
||||
|
||||
switch {
|
||||
case token.Type == Name && strings.ToLower(token.Value) == "content-type":
|
||||
{
|
||||
@ -117,16 +125,7 @@ func (d *httpBodyContentTyper) Tokenise(options *TokeniseOptions, text string) (
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return token
|
||||
}
|
||||
|
||||
if subIterator != nil {
|
||||
for token := subIterator(); token != EOF; token = subIterator() {
|
||||
return token
|
||||
}
|
||||
}
|
||||
return EOF
|
||||
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user