[aKregator-devel] [Bug 105895] Doesn't support XHTML in Blogger feeds
Brought to you by:
lippel
From: Heinrich W. <h_w...@co...> - 2005-06-28 23:02:01
|
------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=105895 h_wendel cojobo net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From h_wendel cojobo net 2005-06-29 01:01 ------- 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); } |