Permalink
Browse files

Merge pull request #5 from Kulgar/master

Solving the [list][*]list item[/list] converting issue
  • Loading branch information...
2 parents 314e605 + 71f9124 commit 7fcffe1e4d51f1deca0f3361b3e3b0daa8d0c4be @cpjolicoeur committed Mar 1, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/bb-ruby.rb
  2. +3 −0 test/test_bb-ruby.rb
View
@@ -90,7 +90,7 @@ module BBRuby
'[*]list item',
:listitem],
'Unordered list (alternative)' => [
- /\[list(:.*)?\]((?:(?!list).)*)\[\/list(:.)?\1?\]/mi,
+ /\[list(:.*)?\]((?:(?!\[list(:.*)?\]).)*)\[\/list(:.)?\1?\]/mi,
'<ul>\2</ul>',
'Unordered list item',
'[list][*]item 1[*] item2[/list]',
@@ -1,4 +1,5 @@
#! /usr/bin/env ruby
+#coding: utf-8
require File.dirname(__FILE__) + '/test_helper.rb'
@@ -68,6 +69,8 @@ def test_unordered_list
def test_list_unordered
assert_equal '<ul><li>item 1</li><li>item 2</li></ul>', '[list][li]item 1[/li][li]item 2[/li][/list]'.bbcode_to_html
+ #Added this test which raising an error because of the "list" word in list items.
+ assert_equal '<ul><li>list item 1</li><li>list item 2</li></ul>', '[list][li]list item 1[/li][li]list item 2[/li][/list]'.bbcode_to_html
assert_equal '<ul><li>item 1</li><li>item 2</li></ul>', '[list:7a9ca2c5c3][li]item 1[/li][li]item 2[/li][/list:o:7a9ca2c5c3]'.bbcode_to_html
assert_equal '<ul><li>item 1</li><li>item 2</li></ul><ul><li>item 3</li><li>item 4</li></ul>',
'[list:7a9ca2c5c3][li]item 1[/li][li]item 2[/li][/list:o:7a9ca2c5c3][list:7a9ca2c5c3][li]item 3[/li][li]item 4[/li][/list:o:7a9ca2c5c3]'.bbcode_to_html

0 comments on commit 7fcffe1

Please sign in to comment.