bb-ruby 0.9 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ == 0.9.2 2009-06-10
2
+
3
+ * implement auto links
4
+
1
5
  == 0.9 2009-05-20
2
6
 
3
7
  * bugfix
@@ -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'
5
+ VERSION = '0.9.2'
6
6
 
7
7
  # allowable image formats
8
8
  @@imageformats = 'png|bmp|jpg|gif|jpeg'
@@ -148,15 +148,12 @@ module BBRuby
148
148
  'Hyperlink (implied)',
149
149
  "Maybe try looking on [url]http://google.com[/url]",
150
150
  :link],
151
- #
152
- # TODO: fix automatic links
153
- #
154
- # 'Link (Automatic)' => [
155
- # /http:\/\/(.*?)[^<\/a>]/,
156
- # '<a href="\1">\1</a>',
157
- # 'Hyperlink (automatic)',
158
- # nil, nil,
159
- # :link],
151
+ 'Link (Automatic)' => [
152
+ /\s(https?:\/\/.*?(?=\s))/,
153
+ ' <a href="\1">\1</a>',
154
+ 'Hyperlink (automatic)',
155
+ 'Maybe try looking on http://www.google.com',
156
+ :link],
160
157
  'Image (Resized)' => [
161
158
  /\[img(:.+)? size=(['"]?)(\d+)x(\d+)\2\](.*?)\[\/img\1?\]/im,
162
159
  '<img src="\5" style="width: \3px; height: \4px;" />',
@@ -107,7 +107,7 @@ class TestBBRuby < Test::Unit::TestCase
107
107
 
108
108
  def test_double_quote
109
109
  assert_equal '<fieldset><legend>Kitten</legend><blockquote><fieldset><legend>creatiu</legend><blockquote>f1</blockquote></fieldset>f2</blockquote></fieldset>',
110
- '[quote:26fe26a6a9="Kitten"][quote:26fe26a6a9="creatiu"]f1[/quote:26fe26a6a9]f2[/quote:26fe26a6a9]'.bbcode_to_html.bbcode_to_html({}, false, :disable)
110
+ '[quote:26fe26a6a9="Kitten"][quote:26fe26a6a93="creatiu"]f1[/quote:26fe26a6a93]f2[/quote:26fe26a6a9]'.bbcode_to_html.bbcode_to_html({}, false, :disable)
111
111
  end
112
112
 
113
113
  def test_link
@@ -141,6 +141,10 @@ class TestBBRuby < Test::Unit::TestCase
141
141
  assert_equal '<a href="mailto:wadus@wadus.com">wadus@wadus.com</a>', '[email]wadus@wadus.com[/email]'.bbcode_to_html
142
142
  end
143
143
 
144
+ def test_auto_link
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
+ end
147
+
144
148
  def test_html_escaping
145
149
  assert_equal "<strong>&lt;i&gt;foobar&lt;/i&gt;</strong>", '[b]<i>foobar</i>[/b]'.bbcode_to_html
146
150
  assert_equal "<strong><i>foobar</i></strong>", '[b]<i>foobar</i>[/b]'.bbcode_to_html({}, false)
@@ -169,7 +173,7 @@ class TestBBRuby < Test::Unit::TestCase
169
173
  end
170
174
 
171
175
  def test_self_tag_list
172
- assert_equal 30, BBRuby.tag_list.size
176
+ assert_equal 31, BBRuby.tag_list.size
173
177
  end
174
178
 
175
179
  def test_redefinition_of_tag_html
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"
4
+ version: 0.9.2
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-05-21 00:00:00 -04:00
12
+ date: 2009-06-10 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency