# HG changeset patch # User teknolog # Date 1267286359 0 # Node ID 9219912415dc788bad6af155518c75043d3ac3bb # Parent cda6e6257514f49e8bef2ce9820fbe8eb97c209b Even more improved HTML cleaning diff -r cda6e6257514 -r 9219912415dc application/src/PodcastFeedView.cpp --- a/application/src/PodcastFeedView.cpp Sat Feb 27 14:40:44 2010 +0000 +++ b/application/src/PodcastFeedView.cpp Sat Feb 27 15:59:19 2010 +0000 @@ -119,11 +119,6 @@ iUpdater = CPodcastFeedViewUpdater::NewL(*this); DP("CPodcastFeedView::ConstructL END"); - - TBuf<1024> test; - test.Copy(_L("Yeah, we’re doing an episode. "hej" © fl ong Should you get used to it? Ummm… maybe not. But let’s enjoy the ride while it lasts! Today we just yammer on about whatever, mostly just about what we’ve been up to. Until next time!")); - - PodcastUtils::CleanHtmlL(test); } CPodcastFeedView::~CPodcastFeedView() diff -r cda6e6257514 -r 9219912415dc engine/src/PodcastUtils.cpp --- a/engine/src/PodcastUtils.cpp Sat Feb 27 14:40:44 2010 +0000 +++ b/engine/src/PodcastUtils.cpp Sat Feb 27 15:59:19 2010 +0000 @@ -71,10 +71,9 @@ // miscellaneous cleanup const TChar KLineBreak(CEditableText::ELineBreak); _LIT(KNewLine, "\n"); - // ReplaceChar(str, '"', '\''); + _LIT(KNewLineWindows, "\r\n"); ReplaceString(str, KNewLine, KNullDesC); - str.Trim(); - + ReplaceString(str, KNewLineWindows, KNullDesC); // strip out HTML tags @@ -198,6 +197,19 @@ } CleanupStack::PopAndDestroy(tmpBuf); + + // chop away newlines at start + while (str[0] == KLineBreak) { + str = str.Mid(1); + } + + // chop away newlines at end + + while (str[str.Length()-1] == KLineBreak) { + str = str.Left(str.Length()-1); + } + + str.Trim(); } EXPORT_C void PodcastUtils::RemoveAllFormatting(TDes & aString)