xhtml_report_generator 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xhtml_report_generator/custom.rb +14 -10
- data/lib/xhtml_report_generator/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be9f999ed4d1ead1cef830e239d46b804d90637
|
4
|
+
data.tar.gz: 4cc7489305ec224f61475e3df988ec3b5e51edb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c0ab9f13b5419145b8aefaf88691f913e5740d81ac19e6a23cf094298fe169b47215a8586846ede0cefbed5ad9940a00b96ab18f34ff9f602d4fa9906d39de4
|
7
|
+
data.tar.gz: 002c248c1732f2c5a43010a44b14c96f56758544272d946d281f27180485c232bbf41e2d944537ea5010bbabffc9fabe618030bb2ed91651cccd7bfa39cdb81f
|
@@ -180,7 +180,7 @@ module Custom
|
|
180
180
|
for i in arr do
|
181
181
|
# detach from current
|
182
182
|
i.parent = nil
|
183
|
-
if i.
|
183
|
+
if i.is_a?(REXML::Text)
|
184
184
|
# in general a text looks as follows:
|
185
185
|
# .*(matchstring|.*)*
|
186
186
|
|
@@ -201,7 +201,7 @@ module Custom
|
|
201
201
|
# for non-text nodes we recurse into it and finally reattach to our parent to preserve ordering
|
202
202
|
num_matches += highlight_captures(regex, color, i)
|
203
203
|
el.add(i)
|
204
|
-
end # if i.
|
204
|
+
end # if i.is_a?(REXML::Text)
|
205
205
|
end # for i in arr do
|
206
206
|
return num_matches
|
207
207
|
end
|
@@ -226,7 +226,7 @@ module Custom
|
|
226
226
|
# detach from current
|
227
227
|
i.parent = nil
|
228
228
|
#puts i.class.to_s()
|
229
|
-
if i.
|
229
|
+
if i.is_a?(REXML::Text)
|
230
230
|
# in general a text looks as follows:
|
231
231
|
# .*(matchstring|.*)*
|
232
232
|
|
@@ -242,7 +242,7 @@ module Custom
|
|
242
242
|
# puts "recurse"
|
243
243
|
num_matches += highlight(regex, color, i)
|
244
244
|
el.add(i)
|
245
|
-
end # if i.
|
245
|
+
end # if i.is_a?(REXML::Text)
|
246
246
|
end # for i in arr do
|
247
247
|
return num_matches
|
248
248
|
end
|
@@ -338,8 +338,8 @@ module Custom
|
|
338
338
|
# some <span>arbitrary</span>
|
339
339
|
# text child content
|
340
340
|
# </test>
|
341
|
-
# @param
|
342
|
-
# @param
|
341
|
+
# @param parent [REXML::Element] the parent to which "element" should be attached after parsing, e.g. <test>
|
342
|
+
# @param element [REXML::Element] the Text element, into which tags will be added at the specified indices of @index_length_array, e.g. the REXML::Text children of <test> in the example
|
343
343
|
# @param tagname [String] the tag that will be introduced as <tagname> at the indices specified
|
344
344
|
# @param attribs [Hash] Attributes that will be added to the inserted tag e.g. <tagname attrib="test">
|
345
345
|
# @param index_length_array [Array] Array of the form [[index, lenght], [index, lenght], ...] that specifies
|
@@ -352,8 +352,10 @@ module Custom
|
|
352
352
|
for j in index_length_array do
|
353
353
|
# reattach normal (unmatched) text
|
354
354
|
if j[0] > last_end
|
355
|
-
text = REXML::Text.new(element.value()[ last_end, j[0] - last_end ])
|
356
|
-
parent.add_text(text)
|
355
|
+
# text = REXML::Text.new(element.value()[ last_end, j[0] - last_end ])
|
356
|
+
# parent.add_text(text)
|
357
|
+
# add text without creating a textnode, textnode screws up formatting (e.g. all whitespace are condensed into one)
|
358
|
+
parent.add_text( element.value()[ last_end, j[0] - last_end ] )
|
357
359
|
end
|
358
360
|
#create the tag node with attributes and add the text to it
|
359
361
|
tag = parent.add_element(REXML::Element.new(tagname), attribs)
|
@@ -363,8 +365,10 @@ module Custom
|
|
363
365
|
# in the last round check for any remaining text
|
364
366
|
if index == index_length_array.length - 1
|
365
367
|
if last_end < element.value().length
|
366
|
-
text = REXML::Text.new(element.value()[ last_end, element.value().length - last_end ])
|
367
|
-
parent.add(text)
|
368
|
+
# text = REXML::Text.new(element.value()[ last_end, element.value().length - last_end ])
|
369
|
+
# parent.add(text)
|
370
|
+
# add text without creating a textnode, textnode screws up formatting (e.g. all whitespace are condensed into one)
|
371
|
+
parent.add_text( element.value()[ last_end, element.value().length - last_end ] )
|
368
372
|
end
|
369
373
|
end
|
370
374
|
index += 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xhtml_report_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Widmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "The generator can be used to create html or xhtml files. It comes with
|
14
14
|
many utility functions.\n \nThe javascript to render the table of contents, the
|
@@ -51,9 +51,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.6.2
|
55
55
|
signing_key:
|
56
56
|
specification_version: 4
|
57
57
|
summary: A simple html or xhtml generator or logger to create human readable reports
|
58
58
|
and logs
|
59
59
|
test_files: []
|
60
|
+
has_rdoc:
|