bb-ruby 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.9.3 2009-06-11
2
+
3
+ * better auto link support
4
+
1
5
  == 0.9.2 2009-06-10
2
6
 
3
7
  * implement auto links
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module BBRuby
5
- VERSION = '0.9.2'
5
+ VERSION = '0.9.3'
6
6
 
7
7
  # allowable image formats
8
8
  @@imageformats = 'png|bmp|jpg|gif|jpeg'
@@ -149,8 +149,8 @@ module BBRuby
149
149
  "Maybe try looking on [url]http://google.com[/url]",
150
150
  :link],
151
151
  'Link (Automatic)' => [
152
- /\s(https?:\/\/.*?(?=\s))/,
153
- ' <a href="\1">\1</a>',
152
+ /(\A|\s)((https?:\/\/|www\.)[^\s<]+)/,
153
+ ' <a href="\2">\2</a>',
154
154
  'Hyperlink (automatic)',
155
155
  'Maybe try looking on http://www.google.com',
156
156
  :link],
@@ -143,6 +143,10 @@ class TestBBRuby < Test::Unit::TestCase
143
143
 
144
144
  def test_auto_link
145
145
  assert_equal %Q(previous text <a href="http://www.google.com">http://www.google.com</a> post text), 'previous text http://www.google.com post text'.bbcode_to_html
146
+ assert_equal %Q( <a href="http://google.com">http://google.com</a> is my favorite search engine), 'http://google.com is my favorite search engine'.bbcode_to_html
147
+ assert_equal %Q(Try using google <a href="http://google.com">http://google.com</a>), 'Try using google http://google.com'.bbcode_to_html
148
+ assert_equal %Q(Try using googlehttp://google.com), 'Try using googlehttp://google.com'.bbcode_to_html
149
+ assert_equal %Q( <a href="http://google.com">http://google.com</a>), 'http://google.com'.bbcode_to_html
146
150
  end
147
151
 
148
152
  def test_html_escaping
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bb-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig P Jolicoeur
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-10 00:00:00 -04:00
12
+ date: 2009-06-11 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.1
23
+ version: 1.2.1
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe