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) {
// hget http://codereview.appspot.com/rss/mine/rsc
const rssFeedString = `
<?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">
An attempt at adding pubsubhubbub support to Rietveld.
http://code.google.com/p/pubsubhubbub
......@@ -125,8 +125,8 @@ var rssFeed = Feed{
Id: "http://codereview.appspot.com/",
Updated: "2009-10-04T01:35:58+00:00",
Author: Person{
Name: "rietveld",
InnerXML: "<name>rietveld</name>",
Name: "rietveld<>",
InnerXML: "<name>rietveld&lt;&gt;</name>",
},
Entry: []Entry{
Entry{
......
......@@ -795,8 +795,9 @@ Input:
var i int
CharLoop:
for i = 0; i < len(p.tmp); i++ {
p.tmp[i], p.err = p.r.ReadByte()
if p.err != nil {
var ok bool
p.tmp[i], ok = p.getc()
if !ok {
if p.err == os.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