rexleparser 0.5.6 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4b6d8eb484cc043528251eeb48dcddfefc9d70d
4
- data.tar.gz: 27082d4e1ccf1d1974f4891dd25faf6ef5293ff8
3
+ metadata.gz: 8a5d991a280ef4abae08dec0939207a3f733a186
4
+ data.tar.gz: ed2b52b5072bb4ce90e7a53735c4b335296d4290
5
5
  SHA512:
6
- metadata.gz: 6df827ab903aa50b05c5c8a730335971cf41a37e6a15d2bf6873867a92cddc12c65c032927f1f9895b3d1311ea08f1ae647ec2187e99833a772c4981804cc599
7
- data.tar.gz: de37449024efce01f6f8256a76ab6aee5a8097d7bcea0ba2f540580aaf965b314771db6de52cf67ea556b3fb435599b9f34f1381f78221e15aac55e8c673bc35
6
+ metadata.gz: 103473a843dc1f21e19eb695b14cfbd1d55b4a3ad488436dcce351e373d51be8f129eb00bedbfc70d79342e8339ca349856814fea46c0e869d291163d0eee6ff
7
+ data.tar.gz: 423384afc80e9565070228760c3097a85caa75ee5cb2864d54830ecd36466090e6e644ff7a76dd45a83c4b8de40773108ad4f0e5a1c5802551778dcd55e74c64
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,7 +15,7 @@ class RexleParser
15
15
  @doctype = s.slice!(/<!DOCTYPE html>\n?/)
16
16
 
17
17
  @to_a = reverse(parse_node(s.strip.gsub(/<\?[^>]+>/,'').reverse))
18
-
18
+
19
19
  end
20
20
 
21
21
 
@@ -23,7 +23,7 @@ class RexleParser
23
23
 
24
24
 
25
25
  def scan_next(r, tagname)
26
-
26
+
27
27
  j = tagname
28
28
 
29
29
  if r[0] == '>' then
@@ -31,7 +31,7 @@ class RexleParser
31
31
  # end tag match
32
32
  tag = r[/^>[^<]+</]
33
33
 
34
- if tag[/^>[^\]\-].*[^\/]<$/m] then
34
+ if tag[1][/[ \w"']/] and tag[-2] != '/' then
35
35
 
36
36
  # is it the end tag to match the start tag?
37
37
  tag = r.slice!(/^>[^<]+</)
@@ -47,13 +47,18 @@ class RexleParser
47
47
  broken_tag = tag
48
48
  return [:child, [nil, [], broken_tag]] if broken_tag
49
49
  else
50
+
51
+ text, newtag = tag.sub('>',';tg&').split(/>/,2)
52
+
53
+ if newtag then
54
+ tag = newtag
55
+ r.prepend '>' + tag
56
+ end
50
57
 
51
- text, tag = tag.sub('>',';tg&').split(/>/,2)
52
- r.prepend '>' + tag
53
58
  return [:child, text]
54
59
  end
55
- elsif tag[/\/<$/] then
56
- return [:child, parse_node(r)]
60
+ elsif tag[/>\/|\/<$/] then
61
+ return [:newnode]
57
62
  elsif r[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/m] then
58
63
 
59
64
  i = r =~ /(\-\-!<|\[ATADC\[!<)/
@@ -72,7 +77,9 @@ class RexleParser
72
77
  else
73
78
 
74
79
  # it's a text value
75
- text = r.slice!(/[^>]+/)
80
+ i = r =~ />["'\w]/
81
+ text = r.slice!(0,i)
82
+
76
83
  return [:child, text] if text
77
84
  end
78
85
  end
@@ -128,6 +135,8 @@ class RexleParser
128
135
  children << res
129
136
  when :newnode
130
137
  children << parse_node(r, tagname)
138
+ else
139
+ break
131
140
  end
132
141
  end
133
142
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexleparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  CkjTMLaPwIQI6dsbG4bVJ7/XzL7c8niqJSF7M0yr1+2kUrWFUZMBMrUUxgZxSkjL
32
32
  Cgd76bp2zjiyCw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-01-29 00:00:00.000000000 Z
34
+ date: 2015-01-30 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- "��ߑ�P5�Ã�� ����[{ p~yk��_�Tf�?̎L��)�l6{��S����{yWk��Uyத��?���伧��M���n��ݘ-$T�q���
1
+ ��%��Q긞�V7N�����2V7#���e������'�ȓS�O�R���o]cW��߳tյ��/��-� ���:gXe `�m����|���S�a�&���1i��I��cRua�Ҷ�t�N��D-���N�$Cl�^�G��[Q��$&�!U�U�M 3Ϊo�>ޱtht�@=�7�%�jr���)q���h����������" "qƎ+�`gLJN
2
+ ~̦�����R����R�t��)�l�6�