rexleparser 0.5.1 → 0.5.2

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: 184b302c376712daab6a0df650cfe03ac5a40c4d
4
- data.tar.gz: 691646e7927e878c6341febc8c18406093654fda
3
+ metadata.gz: 1541fbb74cf785e0ff1c38ae076d570372fbf468
4
+ data.tar.gz: 33c1b4d431157a46e45c4fd30a92f97aa1cae272
5
5
  SHA512:
6
- metadata.gz: 811abaa767db4514dc6ba1da8a5dd4420d1fbbef17ee2bfa6c0842c2152a13f9a7fa090d8189403a32585923ae800bad6d43985df1c6a55e1d7d120abcb9df6e
7
- data.tar.gz: caa1b074ec6de75c8ad087808c830889e149a4e543398a2cedcf9d0c2f4d92d276291d86b503b774550db65f53335f43bdec1263298e49aaec724af54e74c3e6
6
+ metadata.gz: 8af15120d4030641f0ec8063fa4e0ebb6f43e1b08ea89075e938031100c1701718867376219fa94d76b443c1600ec9769ebe0f7435b985fb6e113e051fd510bd
7
+ data.tar.gz: bbee51bcc5625bfd0d9e97d6f5dc168d1cecf958a7d56839916044514ba0e56389017c84772fcd217f2f294f69652cb7c073c532e98626dab2a5b21cf42d126d
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rexleparser.rb CHANGED
@@ -24,11 +24,11 @@ class RexleParser
24
24
 
25
25
 
26
26
  def scan_next(r, tagname)
27
-
27
+
28
28
  j = tagname
29
29
 
30
30
  if (r =~ /^>/) == 0 then
31
-
31
+
32
32
  # end tag match
33
33
  tag = r[/^>[^<]+</]
34
34
 
@@ -49,17 +49,24 @@ class RexleParser
49
49
  broken_tag = tag
50
50
  return [:child, [nil, [], broken_tag]] if broken_tag
51
51
 
52
- elsif tag[/^>--(.*)--!</] then
53
-
52
+ elsif tag[/^>--.*--!</] then
53
+
54
54
  # it's a comment tag
55
- return [:child, $1]
55
+ return [:child, create_comment(tag)]
56
56
  else
57
57
 
58
58
  text, tag = tag.sub('>',';tg&').split(/>/,2)
59
59
  r.prepend '>' + tag
60
60
  return [:child, text]
61
- end
61
+ end
62
+
63
+ elsif tag[/^>--.*--!</m] then
64
+
65
+ i = r =~ /--!</
66
+ tag = r.slice!(0,i+4)
62
67
 
68
+ # it's a comment tag
69
+ return [:child, create_comment(tag)]
63
70
  else
64
71
 
65
72
  # it's a start tag?
@@ -75,6 +82,11 @@ class RexleParser
75
82
  end
76
83
  end
77
84
 
85
+ def create_comment(tag)
86
+ tagname = '-!'
87
+ return [">#{tagname}<", [tag[/>--(.*)--!</m,1]], ">#{tagname}/<"]
88
+ end
89
+
78
90
  def parse_node(r, j=nil)
79
91
 
80
92
  return unless r.length > 0
@@ -87,8 +99,7 @@ class RexleParser
87
99
  tag += r.slice!(0,i+5)
88
100
 
89
101
  # it's a comment tag
90
- tagname = '-!'
91
- return [">#{tagname}<", [tag[/>--(.*)--!</,1]], ">#{tagname}/<"]
102
+ return create_comment tag
92
103
  end
93
104
 
94
105
  tagname = tag[/([\w!]+)\/?<$/,1]
@@ -159,4 +170,4 @@ class RexleParser
159
170
 
160
171
  return [tag[/[!\-\w\[]+/], ltext, get_attributes(tag), *r]
161
172
  end
162
- end
173
+ end
data.tar.gz.sig CHANGED
Binary file
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.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file