[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[patch] updates for rdf,rdflong in english/template/debian/recent_list.wml



Hi,

I've been (trying to) read the Debian Security Advisories using an RSS
newsfeed reader, and have a couple of issues with the rdflong format.

Firstly, I know it was alfie's preference to have only the first paragraph
(as bounded by <p>...</p>) of the DSA in the RDF file, but this doesn't
always make good sense.  Take for example DSA 265, where there is a </p>
right before the actual interesting bit that you'd actually want to read.

My personal preference would be for the $moreinfo to get the entire
advisory, not just that first paragraph.  If you're reading the dsa-long
file it's going to be because you actually want to read it yourself then
and there (not stick it in a box on the side of a web page) as a more
light-weight alternative to using a web browser to read the HTML pages.
That's what apps like straw (GNOME RSS reader which alfie mentioned) and
NetNewsWire Lite (a similar program for Mac OS X) are for.  So it's not
much help to get just the first couple of lines of the DSA and then have
to go and open up the advisory again in a web browser.  Let's have the
whole thing.

Secondly, as far as I know the HTML tags being used in the DSA wml files
are not valid in RDF.  I've looked through the W3C docs on RDF and can't
find anything that says HTML is allowed in <description> containers.  It
might work in straw but doesn't in NNWL.  So I think HTML tags should be
removed from the RDF format.

I'm suggesting the following patch to implement these changes:

[harp:/usr/local/src/Debian/debian-www/webwml/english/template/debian]$ cvs diff recent_list.wml 
Index: recent_list.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/template/debian/recent_list.wml,v
retrieving revision 1.106
diff -u -p -r1.106 recent_list.wml
--- recent_list.wml     16 Jan 2003 17:29:50 -0000      1.106
+++ recent_list.wml     22 Mar 2003 10:54:20 -0000
@@ -171,7 +171,7 @@ foreach $file (@files) {
     $date = qq/$1/; }       # events
   if ($content =~ /^<define-tag description>(.*?)<\/define-tag>$/ms) {
     $desc = qq/$1/; }       # security
-  if ($content =~ /^<define-tag moreinfo>(?:(.*?<\/p>)|(.*?)<\/define-tag>)$/ms) {
+  if ($content =~ /^<define-tag moreinfo>(.*?)<\/define-tag>)$/ms) {
     $moreinfo = qq/$1/; }   # dsa-long.XX.rdf
   if ($content =~ /^<define-tag status>(.*?)<\/define-tag>$/ms) {
     $status = qq/$1/; }     # vote
@@ -217,6 +217,8 @@ foreach $file (@files) {
 </item>
 ";
     } elsif ($format eq 'rdflong') {
+      # Nuke HTML tags (ugly kluge).
+      $moreinfo =~ s#</?(?:p|ul|li)>##g;
       $str1 = "
 <item rdf:about=\"http://www.debian.org/security/$year/$base\";>
   <title>$title - $desc</title>


I considered using 's#</?\w+>##' instead but was concerned about
clobbering wml tags like <protect>, <suck> etc.  Someone may have a much
better solution though.

Thirdly, and this probably isn't really much of an issue, but I don't
think the Debian web server knows about .rdf files: it sents out a
Content-Type of text/plain rather than text/xml.  Maybe they could simply
be given a .xml extension instead of .rdf?  (This is how a lot of sites
with RSS feeds do it.)

Thanks for your consideration.  =)

Andrew.

-- 
Andrew Shugg <andrew@neep.com.au>                   http://www.neep.com.au/

"Just remember, Mr Fawlty, there's always someone worse off than yourself."
"Is there?  Well I'd like to meet him.  I could do with a good laugh."



Reply to: