Skip to content

Instantly share code, notes, and snippets.

@paulkoegel
Created November 30, 2011 10:54
Show Gist options
  • Save paulkoegel/1408656 to your computer and use it in GitHub Desktop.
Save paulkoegel/1408656 to your computer and use it in GitHub Desktop.
auto_link XML fuckup
- raise auto_link @text
"Winamp for Mac." Wait, what!? <a href="http://t.co/z7weqDII"{:xmlns=>"http://www.w3.org/1999/xhtml", "xml:lang"=<{:rel=>"nofollow", :class=<nil}, :lang=>{:rel=<"nofollow", :class=>nil}}<http://t.co/z7weqDII>/a<
not reproducible in console, where everything looks like it should:
ruby-1.9.3-p0 :001 > t = GridItem.tweets.any_in(:hashtags => ['sebastian_kippe']).first.text
=> "\"Winamp for Mac.\" Wait, what!? http://t.co/z7weqDII"
ruby-1.9.3-p0 :002 > helper.auto_link t
=> "\"Winamp for Mac.\" Wait, what!? <a href=\"http://t.co/z7weqDII\" rel=\"nofollow\">http://t.co/z7weqDII</a>"
ruby-1.9.3-p0 :003 > include Twitter::Autolink
=> Object
ruby-1.9.3-p0 :004 > auto_link t
=> "\"Winamp for Mac.\" Wait, what!? <a href=\"http://t.co/z7weqDII\" rel=\"nofollow\">http://t.co/z7weqDII</a>"
ruby-1.9.3-p0 :005 > auto_link t + "@billy #ripe"
=> "\"Winamp for Mac.\" Wait, what!? <a href=\"http://t.co/z7weqDII\" rel=\"nofollow\">http://t.co/z7weqDII</a>@<a class=\"tweet-url username\" href=\"http://twitter.com/billy\" rel=\"nofollow\">billy</a> <a href=\"http://twitter.com/search?q=%23ripe\" title=\"#ripe\" class=\"tweet-url hashtag\" rel=\"nofollow\">#ripe</a>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment