bbcoder 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/bbcoder/tag.rb +4 -3
- data/lib/bbcoder/version.rb +1 -1
- data/spec/bbcoder_spec.rb +4 -0
- metadata +6 -6
data/Gemfile.lock
CHANGED
data/lib/bbcoder/tag.rb
CHANGED
@@ -8,7 +8,7 @@ class BBCoder
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def to_html(meta, content)
|
11
|
-
return self.class.reform(name, meta, content) unless content_valid?(content)
|
11
|
+
return self.class.reform(name, meta, content, true) unless content_valid?(content)
|
12
12
|
|
13
13
|
|
14
14
|
if options[:block].nil?
|
@@ -23,6 +23,7 @@ class BBCoder
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def content_valid?(content)
|
26
|
+
return false if content.nil?
|
26
27
|
return true if options[:match].nil?
|
27
28
|
|
28
29
|
return !content.match(options[:match]).nil?
|
@@ -37,8 +38,8 @@ class BBCoder
|
|
37
38
|
BBCoder.configuration[tag].to_html(meta, content)
|
38
39
|
end
|
39
40
|
|
40
|
-
def reform(tag, meta, content = nil)
|
41
|
-
if content.nil?
|
41
|
+
def reform(tag, meta, content = nil, force_end = false)
|
42
|
+
if content.nil? && !force_end
|
42
43
|
%(#{reform_open(tag, meta)})
|
43
44
|
else
|
44
45
|
%(#{reform_open(tag, meta)}#{content}#{reform_end(tag)})
|
data/lib/bbcoder/version.rb
CHANGED
data/spec/bbcoder_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbcoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-07-
|
12
|
+
date: 2011-07-21 00:00:00.000000000 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &15548820 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *15548820
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rr
|
28
|
-
requirement: &
|
28
|
+
requirement: &15548280 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *15548280
|
37
37
|
description: A gem for parsing bbcode that doesn't rely on regular expressions
|
38
38
|
email:
|
39
39
|
- machinist@asceth.com
|