mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
xml: allow text segments to end at EOF
Fixes #674. R=adg CC=golang-dev https://golang.org/cl/1018042
This commit is contained in:
parent
de92199648
commit
0485ba72c3
3 changed files with 31 additions and 7 deletions
|
|
@ -758,9 +758,15 @@ func (p *Parser) text(quote int, cdata bool) []byte {
|
|||
p.buf.Reset()
|
||||
Input:
|
||||
for {
|
||||
b, ok := p.mustgetc()
|
||||
b, ok := p.getc()
|
||||
if !ok {
|
||||
return nil
|
||||
if cdata {
|
||||
if p.err == os.EOF {
|
||||
p.err = p.syntaxError("unexpected EOF in CDATA section")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
break Input
|
||||
}
|
||||
|
||||
// <![CDATA[ section ends with ]]>.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue