Version: 1.0.2 (using KDE KDE 3.4.0) Installed from: Debian testing/unstable Packages Akregator does not properly parse the style of XHTML used by Blogger, and breaks the formatting (mainly, the lack of parsing of <BR />) on all several thousand blogs hosted by Blogger.
Example: http://shadowconflict.blogspot.com/atom.xml Confirmed for KDE 3.4 and SVN HEAD.
SVN commit 429812 by lanius: support for mode element in atom feeds BUG: 105895 M +1 -0 addfeeddialog.cpp M +16 -1 librss/tools_p.cpp M +1 -0 librss/tools_p.h --- trunk/KDE/kdepim/akregator/src/addfeeddialog.cpp #429811:429812 @@ -36,6 +36,7 @@ #include <kdebug.h> #include <ksqueezedtextlabel.h> #include <kmessagebox.h> +#include <kurl.h> using namespace Akregator; --- trunk/KDE/kdepim/akregator/src/librss/tools_p.cpp #429811:429812 @@ -28,6 +28,15 @@ return KRFCDate::parseDateISO8601(s + "T12:00:00"); } +QString RSS::childNodesAsXML(const QDomNode& parent) +{ + QDomNodeList list = parent.childNodes(); + QString str; + QTextStream ts( &str, IO_WriteOnly ); + for (uint i = 0; i < list.count(); ++i) + ts << list.item(i); + return str.stripWhiteSpace(); +} QString RSS::extractNode(const QDomNode &parent, const QString &elemName, bool isInlined) { @@ -35,8 +44,14 @@ if (node.isNull()) return QString::null; - QString result = node.toElement().text(); + QDomElement e = node.toElement(); + QString result; + if (elemName == "content" && ((e.hasAttribute("mode") && e.attribute("mode") == "xml") || !e.hasAttribute("mode"))) + result = childNodesAsXML(node); + else + result = e.text(); + bool hasPre = result.contains("<pre>",false); bool hasHtml = hasPre || result.contains("<"); // FIXME: test if we have html, should be more clever -> regexp if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts --- trunk/KDE/kdepim/akregator/src/librss/tools_p.h #429811:429812 @@ -28,6 +28,7 @@ QString extractNode(const QDomNode &parent, const QString &elemName, bool isInlined=true); QString extractTitle(const QDomNode &parent); + QString childNodesAsXML(const QDomNode& parent); time_t parseISO8601Date(const QString &s); }