spacify 0.0.0 → 0.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.
- data/VERSION +1 -1
- data/lib/html_attribute.treetop +1 -1
- data/lib/html_node_element.treetop +1 -1
- data/test/test_spacify.rb +5 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/html_attribute.treetop
CHANGED
@@ -4,7 +4,7 @@ grammar HTMLAttribute
|
|
4
4
|
include HTML
|
5
5
|
|
6
6
|
rule attributes
|
7
|
-
attribute space_n_attributes:( space attribute )* {
|
7
|
+
attribute space_n_attributes:( space+ attribute )* {
|
8
8
|
def to_a
|
9
9
|
@attirbute_array ||= [attribute] + space_n_attributes.elements.collect{|space_n_attribute| space_n_attribute.attribute }
|
10
10
|
end
|
@@ -10,7 +10,7 @@ grammar HTMLNodeElement
|
|
10
10
|
# It'd be something like this if I were creating an HTML parser.
|
11
11
|
# But I'm not. (Notice the disconnect in open/close node detection)
|
12
12
|
|
13
|
-
gt name:( !space any )+ ( space attributes )* space
|
13
|
+
gt name:( !space any )+ ( space attributes )* space* '/'? lt {
|
14
14
|
def node_name
|
15
15
|
elements[1].text_value
|
16
16
|
end
|
data/test/test_spacify.rb
CHANGED
@@ -6,6 +6,11 @@ class SpacifyTest < Test::Unit::TestCase
|
|
6
6
|
assert_equal_with_lcs expected, spacer.to_s
|
7
7
|
end
|
8
8
|
|
9
|
+
def test_output_with_spaced_input
|
10
|
+
spacer = Spacer.new expected, :html => '<cfinput[^>]+>'
|
11
|
+
assert_equal_with_lcs expected, spacer.to_s
|
12
|
+
end
|
13
|
+
|
9
14
|
def expected
|
10
15
|
%q|
|
11
16
|
<div id="signin_login_content" class="signin_show">
|