Commit 9f69ab39 authored by Russ Cox's avatar Russ Cox

xml: fix innerxml handling of & escapes

R=r
CC=golang-dev
https://golang.org/cl/1009041
parent 13bb28a4
...@@ -24,7 +24,7 @@ func TestUnmarshalFeed(t *testing.T) { ...@@ -24,7 +24,7 @@ func TestUnmarshalFeed(t *testing.T) {
// hget http://codereview.appspot.com/rss/mine/rsc // hget http://codereview.appspot.com/rss/mine/rsc
const rssFeedString = ` const rssFeedString = `
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><li-nk href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></li-nk><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld</name></author><entry><title>rietveld: an attempt at pubsubhubbub <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><li-nk href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></li-nk><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld&lt;&gt;</name></author><entry><title>rietveld: an attempt at pubsubhubbub
</title><link hre-f="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html"> </title><link hre-f="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html">
An attempt at adding pubsubhubbub support to Rietveld. An attempt at adding pubsubhubbub support to Rietveld.
http://code.google.com/p/pubsubhubbub http://code.google.com/p/pubsubhubbub
...@@ -125,8 +125,8 @@ var rssFeed = Feed{ ...@@ -125,8 +125,8 @@ var rssFeed = Feed{
Id: "http://codereview.appspot.com/", Id: "http://codereview.appspot.com/",
Updated: "2009-10-04T01:35:58+00:00", Updated: "2009-10-04T01:35:58+00:00",
Author: Person{ Author: Person{
Name: "rietveld", Name: "rietveld<>",
InnerXML: "<name>rietveld</name>", InnerXML: "<name>rietveld&lt;&gt;</name>",
}, },
Entry: []Entry{ Entry: []Entry{
Entry{ Entry{
......
...@@ -795,8 +795,9 @@ Input: ...@@ -795,8 +795,9 @@ Input:
var i int var i int
CharLoop: CharLoop:
for i = 0; i < len(p.tmp); i++ { for i = 0; i < len(p.tmp); i++ {
p.tmp[i], p.err = p.r.ReadByte() var ok bool
if p.err != nil { p.tmp[i], ok = p.getc()
if !ok {
if p.err == os.EOF { if p.err == os.EOF {
p.err = p.syntaxError("unexpected EOF") p.err = p.syntaxError("unexpected EOF")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment