Version: 1.0-beta3 "Teemu" (using KDE 3.2.90 (3.3 alpha1, CVS >= 20040522), compiled sources) Compiler: gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) OS: Linux (i686) release 2.6.3 Akregator seems to be unable to display <pre></pre> code passages: Line breaks are removed, so the whole text is one huge line which is usually cut at the end. There are a few articles in the Planet KDE feed where this can be seen.
Hmm.. khtml doesn't support CSS 2.1 white-space: pre-wrap (or mozilla's -moz-pre-wrap, opera's -o-pre-wrap, or IE's word-wrap: break-word. Hopefully we can hack that into khtml in kde 4.0. Until then, we could do a number of things: - not show pre tags at all (display: none them) - show pre tags without formatting (white-space: normal) - keep as is
CVS commit by karchebny: * Fix formatting of <pre> contents. CCMAIL: 84095-done@bugs.kde.org M +18 -3 loader.cpp 1.7 --- kdenonbeta/akregator/src/librss/loader.cpp #1.6:1.7 @@ -258,4 +258,6 @@ const KURL &Loader::discoveredFeedURL() } +#include <kdebug.h> + void Loader::slotRetrieverDone(const QByteArray &data, bool success) { @@ -284,6 +286,20 @@ void Loader::slotRetrieverDone(const QBy } - QByteArray tmpData; - tmpData.setRawData(charData, len); + QCString tmpData(charData, len); + + // hack: support formatting inside <pre> tags + QRegExp pres("<pre>(.+)</pre>", false); + pres.setMinimal(TRUE); + int pos = 0; + while( (pos = pres.search(tmpData, pos)) != -1 ) + { + int len = pres.matchedLength(); + + QCString str = tmpData.mid(pos, len); + str.replace("\n", "<br/>"); + + tmpData.replace(pos, len, str); + pos += len; + } if (doc.setContent(tmpData)) @@ -302,5 +318,4 @@ void Loader::slotRetrieverDone(const QBy } - tmpData.resetRawData(charData, len); } else status = RetrieveError;
This bug seems to have reappeared in a slightly different form since 2004; Akregator now matches pre tags literally instead of allowing for attributes to be added, breaking feeds like this one [1], which uses class="literal-block" in its pre tags. Currently that feed has a post titled "C is not Python" where the example code renders all on one line. I am using Akregator 1.2.5 from KDE 3.5.5, but I looked at the changelog to KDE 3.5.6 and didn't see any fix like this mentioned. [1] http://feeds.feedburner.com/LateralOpinion P.S.: I can't figure out how to set the bug status back to open. Is it better to file a separate bug instead?