MWFeedParser icon indicating copy to clipboard operation
MWFeedParser copied to clipboard

stringByRemovingNewLinesAndWhitespace removes required chars in feed item link

Open giaesp opened this issue 11 years ago • 3 comments

The code

NSString *processedText = [currentText stringByRemovingNewLinesAndWhitespace];

in MWFeedParser.m (line 611) seems to remove required chars. I had problem with some urls in item link similar to

http://www.myfeed.com/node/1062190

The url was changed in

http://www.myfeed.com/node/ 62 90

(with whitespace)

giaesp avatar Mar 06 '13 16:03 giaesp

The same using method stringByConvertingHTMLToPlainText

giaesp avatar Mar 06 '13 16:03 giaesp

Yep had the same problem, just add this around line 600 before the switch(feedType) and you should be good.

NSString *processedText = [[NSString alloc] init];
            if ([currentPath isEqualToString:@"/rss/channel/item/link"] || [currentPath isEqualToString:@"/rdf:RDF/item/link"] || [currentPath isEqualToString:@"/feed/entry/link"]) {
                 processedText = currentText;
            }else
            {
            // Remove newlines and whitespace from currentText
                processedText = [currentText stringByRemovingNewLinesAndWhitespace];
            }

alexkilty avatar Jul 13 '13 00:07 alexkilty

Sorry for the slow reply. That's very strange, I'm not sure why this should be happening. Do you have an example string that I can call stringByRemovingNewLinesAndWhitespace on to reproduce this issue? The above link text (http://www.myfeed.com/node/1062190) works fine in my tests.

mwaterfall avatar Dec 17 '13 18:12 mwaterfall