[OGo-Developer] Note text mangled in RSS

Adam Williams developer@opengroupware.org
Mon, 04 Dec 2006 12:40:18 -0500


> > It appears that the note is placed into the RSS feed by  
> > appendRSSItem in
> > ZideStore/SoObjects/ZSProjects/SxProjectNotesRSS.m -
> > ...
> >   [_r appendContentString:@"        <description>"];
> >   [_r appendContentXMLString:[_note valueForKey:@"noteContent"]];
> >   [_r appendContentString:@"</description>\n"];
> > ...
> > It seems like new lines in the noteContent (which is straight text)
> > should be converted to "<BR/>".
> Possibly. That would be
>    [_r appendContentXMLString:
>      [[_note valueForKey:@"noteContent"]
>              stringByReplacingString:@"\n" withString:@"<BR/>"]];
> But I'm not entirely sure what is allowed in the <description> tag?  
> Should that be (XML escaped) HTML?

The RSS specification -
http://www.rssboard.org/rss-specification#hrelementsOfLtitemgt - doesn't
seem very specific,  but the RSS 2.0 example -
http://www.rssboard.org/files/sample-rss-2.xml - contains an unescaped
"A HREF" tag.

The only relevant text is: "An item may also be complete in itself, if
so, the description contains the text (entity-encoded HTML is allowed;
see examples),"

Yet the examples cited in that paragraph specify to encode HTML tags
like: "<description>this is &lt;b&gt;bold&lt;/b&gt;</description>"

So...
[_r appendContentXMLString:
  [[_note valueForKey:@"noteContent"]
      stringByReplacingString:@"\n" withString:@"&lt;BR/&gt;"]];