ruby-bbcode-to-md 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -146,7 +146,7 @@ module RubyBBCode
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def valid_text_or_opening_element?
|
149
|
-
if @ti.element_is_text? or @ti.element_is_opening_tag?
|
149
|
+
if !RubyBBCode.ignore_validation and @ti.element_is_text? or @ti.element_is_opening_tag?
|
150
150
|
return false if validate_opening_tag == false
|
151
151
|
return false if validate_constraints_on_child == false
|
152
152
|
end
|
@@ -155,7 +155,7 @@ module RubyBBCode
|
|
155
155
|
|
156
156
|
def validate_opening_tag
|
157
157
|
# TODO: rename this if statement to #validate_opening_tag
|
158
|
-
if @ti.element_is_opening_tag?
|
158
|
+
if !RubyBBCode.ignore_validation and @ti.element_is_opening_tag?
|
159
159
|
unless @ti.allowed_outside_parent_tags? or (within_open_tag? and @ti.allowed_in(parent_tag.to_sym))
|
160
160
|
# Tag doesn't belong in the last opened tag
|
161
161
|
throw_child_requires_specific_parent_error; return false
|
@@ -174,7 +174,7 @@ module RubyBBCode
|
|
174
174
|
|
175
175
|
def validate_constraints_on_child
|
176
176
|
# TODO: Rename this if statement to #validate_constraints_on_child
|
177
|
-
if within_open_tag? and parent_has_constraints_on_children?
|
177
|
+
if !RubyBBCode.ignore_validation and within_open_tag? and parent_has_constraints_on_children?
|
178
178
|
# Check if the found tag is allowed
|
179
179
|
last_tag = @dictionary[parent_tag]
|
180
180
|
allowed_tags = last_tag[:only_allow]
|
@@ -189,7 +189,7 @@ module RubyBBCode
|
|
189
189
|
def valid_closing_element?
|
190
190
|
tag = @ti.definition
|
191
191
|
|
192
|
-
if @ti.element_is_closing_tag?
|
192
|
+
if !RubyBBCode.ignore_validation and @ti.element_is_closing_tag?
|
193
193
|
if parent_tag != @ti[:tag].to_sym
|
194
194
|
@errors = ["Closing tag [/#{@ti[:tag]}] does match [#{parent_tag}]"]
|
195
195
|
return false
|
@@ -211,7 +211,7 @@ module RubyBBCode
|
|
211
211
|
tag = @bbtree.current_node.definition
|
212
212
|
|
213
213
|
# this conditional ensures whether the validation is apropriate to this tag type
|
214
|
-
if @ti.element_is_text? and within_open_tag? and tag[:require_between] and candidate_for_using_between_as_param?
|
214
|
+
if !RubyBBCode.ignore_validation and @ti.element_is_text? and within_open_tag? and tag[:require_between] and candidate_for_using_between_as_param?
|
215
215
|
|
216
216
|
# check if valid
|
217
217
|
if @ti[:text].match(tag[:tag_param]).nil?
|
@@ -224,7 +224,7 @@ module RubyBBCode
|
|
224
224
|
|
225
225
|
def validate_all_tags_closed_off
|
226
226
|
# if we're still expecting a closing tag and we've come to the end of the string... throw error
|
227
|
-
throw_unexpected_end_of_string_error if expecting_a_closing_tag?
|
227
|
+
throw_unexpected_end_of_string_error if expecting_a_closing_tag? and !RubyBBCode.ignore_validation
|
228
228
|
end
|
229
229
|
|
230
230
|
def validate_stack_level_too_deep_potential
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-bbcode-to-md
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -108,7 +108,7 @@ rubyforge_project:
|
|
108
108
|
rubygems_version: 1.8.23
|
109
109
|
signing_key:
|
110
110
|
specification_version: 3
|
111
|
-
summary: ruby-bbcode-to-md-0.0.
|
111
|
+
summary: ruby-bbcode-to-md-0.0.8
|
112
112
|
test_files:
|
113
113
|
- test/ruby_bbcode_test.rb
|
114
114
|
- test/test_helper.rb
|