ruby-bbcode 2.0.0 → 2.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ruby-bbcode/bbtree.rb +8 -0
- data/lib/ruby-bbcode/tag_sifter.rb +0 -1
- data/lib/ruby-bbcode/version.rb +1 -1
- data/test/ruby_bbcode_html_test.rb +4 -0
- data/test/unit/tag_sifter_test.rb +0 -1
- data/test/unit/tags_test.rb +2 -2
- metadata +37 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b074eb2a8df2745cba8702182ea59e14620b6c0
|
4
|
+
data.tar.gz: 91083a7047d379cefc3d596c36e867ef2a176d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7410da90e9630381a1a5202ffbd70e4df951dfc9d074c6be65003b9cb759862b71c54c50e818db046bad53603029b40cb3904c1a516c66f859c0e6419d0e101e
|
7
|
+
data.tar.gz: 66cc66ede05370b5c549327a60ce913f58d6e4e507b476de3581e7747a5c5aa9b247e3aa51ea7aa9bc14d206283a69881c9287f4b1467b95612107836974007e
|
data/CHANGELOG.md
CHANGED
data/lib/ruby-bbcode/bbtree.rb
CHANGED
@@ -46,6 +46,14 @@ module RubyBBCode
|
|
46
46
|
|
47
47
|
# Step down the bbtree a notch because we've reached a closing tag
|
48
48
|
def retrogress_bbtree
|
49
|
+
# print @tags_list[-1].inspect
|
50
|
+
if @tags_list[-1].definition[:self_closable]
|
51
|
+
# It is possible that the next (self_closable) tag is on the next line
|
52
|
+
# Remove newline of current tag and parent tag as they are (probably) not intented as an actual newline here but as tag separator
|
53
|
+
@tags_list[-1][:nodes][0][:text].chomp! unless @tags_list[-1][:nodes][0][:text].nil?
|
54
|
+
@tags_list[-2][:nodes][0][:text].chomp! unless @tags_list.length < 2 or @tags_list[-2][:nodes][0][:text].nil?
|
55
|
+
end
|
56
|
+
|
49
57
|
@tags_list.pop # remove latest tag in tags_list since it's closed now...
|
50
58
|
# The parsed data manifests in @bbtree.current_node.children << TagNode.new(element) which I think is more confusing than needed
|
51
59
|
|
@@ -251,7 +251,6 @@ module RubyBBCode
|
|
251
251
|
end
|
252
252
|
|
253
253
|
def parent_of_self_closing_tag?
|
254
|
-
tag_being_parsed = @ti.definition
|
255
254
|
was_last_tag_self_closable = @bbtree.current_node[:definition][:self_closable] unless @bbtree.current_node[:definition].nil?
|
256
255
|
|
257
256
|
was_last_tag_self_closable and last_tag_fit_in_this_tag?
|
data/lib/ruby-bbcode/version.rb
CHANGED
@@ -57,6 +57,10 @@ class RubyBbcodeHtmlTest < Minitest::Test
|
|
57
57
|
assert_equal '<ul><li>item 1</li><li>item 2</li></ul>', '[list][*]item 1[*]item 2[/list]'.bbcode_to_html
|
58
58
|
end
|
59
59
|
|
60
|
+
def test_newline_list_common_syntax
|
61
|
+
assert_equal '<ul><li>item 1</li><li>item 2</li></ul>', "[list]\n[*]item 1\n[*]item 2\n[/list]".bbcode_to_html
|
62
|
+
end
|
63
|
+
|
60
64
|
def test_list_common_syntax_explicit_closing
|
61
65
|
assert_equal '<ul><li>item 1</li><li>item 2</li></ul>', '[list][*]item 1[/*][*]item 2[/*][/list]'.bbcode_to_html
|
62
66
|
end
|
@@ -27,7 +27,6 @@ class TagSifterTest < MiniTest::Test
|
|
27
27
|
# but that captures specifically the .be or .com and treats them differently...
|
28
28
|
def test_youtubes_via_there_url_shortener
|
29
29
|
url_from_shortener = "http://youtu.be/E4Fbk52Mk1w"
|
30
|
-
directory_format = "http://youtube.googleapis.com/v/E4Fbk52Mk1w"
|
31
30
|
expected_output = 'E4Fbk52Mk1w'
|
32
31
|
mock_regex_matches = @@tags[:youtube][:url_matches]
|
33
32
|
|
data/test/unit/tags_test.rb
CHANGED
@@ -3,7 +3,7 @@ require 'test_helper'
|
|
3
3
|
class TagSifterTest < MiniTest::Test
|
4
4
|
def test_taglist_modification
|
5
5
|
tags = RubyBBCode::Tags.tag_list
|
6
|
-
|
6
|
+
assert_nil RubyBBCode::Tags.tag_list[:test]
|
7
7
|
begin
|
8
8
|
tags[:test] = 'test'
|
9
9
|
|
@@ -12,6 +12,6 @@ class TagSifterTest < MiniTest::Test
|
|
12
12
|
# Always restore as this change is permanent (and messes with other tests)
|
13
13
|
tags.delete :test
|
14
14
|
end
|
15
|
-
|
15
|
+
assert_nil RubyBBCode::Tags.tag_list[:test]
|
16
16
|
end
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-bbcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten Bezemer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -56,16 +56,44 @@ dependencies:
|
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.8.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.8.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: term-ansicolor
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "<"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "<"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tins
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "<"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.7'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "<"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.7'
|
69
97
|
description: Convert BBCode to HTML and check whether the BBCode is valid.
|
70
98
|
email: maarten.bezemer@gmail.com
|
71
99
|
executables: []
|
@@ -119,14 +147,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
147
|
version: '0'
|
120
148
|
requirements: []
|
121
149
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.6.8
|
123
151
|
signing_key:
|
124
152
|
specification_version: 4
|
125
|
-
summary: ruby-bbcode-2.0.
|
153
|
+
summary: ruby-bbcode-2.0.1
|
126
154
|
test_files:
|
127
|
-
- test/
|
155
|
+
- test/unit/tag_sifter_test.rb
|
156
|
+
- test/unit/tags_test.rb
|
128
157
|
- test/ruby_bbcode_validity_test.rb
|
129
158
|
- test/ruby_bbcode_bbcode_test.rb
|
159
|
+
- test/test_helper.rb
|
130
160
|
- test/ruby_bbcode_html_test.rb
|
131
|
-
- test/unit/tag_sifter_test.rb
|
132
|
-
- test/unit/tags_test.rb
|