Permalink
Browse files

Fix feed and item display in the text output

Fix feed title/link and item title/link display when outputting a feed item in
text mode. No extra space is put when either feed or item lack a corresponding
URL, and URLs are now on their own line when present.
  • Loading branch information...
1 parent 5f93bf5 commit 535f553dc7dedcb1b26b20dc94360b4f41b3f37d @mpetazzoni mpetazzoni committed with lnussbaum May 5, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/feedparser/text-output.rb
@@ -59,12 +59,12 @@ class FeedItem
def to_text(localtime = true, wrapto = false)
s = ""
s += "Feed: "
- s += @feed.title + ' ' if @feed.title
- s += "<#{@feed.link}>" if @feed.link
+ s += @feed.title if @feed.title
+ s += "\n <#{@feed.link}>" if @feed.link
s += "\n"
s += "Item: "
- s += @title + ' ' if @title
- s += "<#{@link}>" if @link
+ s += @title if @title
+ s += "\n <#{@link}>" if @link
s += "\n"
if @date
if localtime

0 comments on commit 535f553

Please sign in to comment.