Skip to content

Commit

Permalink
Allow quotes in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed May 28, 2012
1 parent 2a0e5ac commit 77a4b3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bb-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module BBRuby
"[quote]Now is the time...[/quote]",
:quote],
'Link' => [
/\[url=(.*?)\](.*?)\[\/url\]/mi,
/\[url=(?:")?(.*?)(?:")?\](.*?)\[\/url\]/mi,
'<a href="\1">\2</a>',
'Hyperlink to somewhere else',
'Maybe try looking on [url=http://google.com]Google[/url]?',
Expand Down
2 changes: 1 addition & 1 deletion lib/bb-ruby/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BBRuby
VERSION = "0.9.6"
VERSION = "0.9.7"
end
2 changes: 2 additions & 0 deletions test/bb-ruby_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def test_link
assert_equal '<a href="http://www.altctrlsupr.com/dmstk/kdd070803/00.html"> ABRIR ALBUM </a>','[URL=http://www.altctrlsupr.com/dmstk/kdd070803/00.html] ABRIR ALBUM [/URL]'.bbcode_to_html
assert_equal %Q(<a href="http://www.altctrlsupr.com/dmstk/kdd070803/00.html"> ABRIR<br />\nALBUM </a>),"[URL=http://www.altctrlsupr.com/dmstk/kdd070803/00.html] ABRIR\nALBUM [/URL]".bbcode_to_html
assert_equal '<a href="http://www.urimalet.com/cadaverex.mp3">aha</a>', "[URL=http://www.urimalet.com/cadaverex.mp3]aha[/URL]".bbcode_to_html
# allow quoted urls:
assert_equal '<a href="http://www.apple.com">aha</a>', '[URL="http://www.apple.com"]aha[/URL]'.bbcode_to_html
end

def test_image
Expand Down

0 comments on commit 77a4b3c

Please sign in to comment.