htx 0.0.8 → 0.0.9
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/htx/template.rb +5 -7
- data/lib/htx/text_parser.rb +2 -0
- data/lib/htx/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 395620b3af20b4da17e4413632418481ee28d6d0fe6b46427af240475087efce
|
4
|
+
data.tar.gz: bc15b61294daaf218b3a3d5a106de7c9279a7d9e8cb7ebd01002fcd618491b1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83805b10f30d1846a187b458579a0748339a3956a4123226b7b9ebdb6dcff6cae3dbcd94913c1bbab2c91186ef3f46642f30a4ed9c3f30b072b3efe2f2ceb1ca
|
7
|
+
data.tar.gz: 26e48419a9a719f1b8b582ef9e525ffcc37affdcb279f0cba95c6fe4cd2108cc6ec66e9ba4d3216a0ef02aad506d56c4743b059916ba78409f0dc672a760a1fc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/lib/htx/template.rb
CHANGED
@@ -62,7 +62,7 @@ module HTX
|
|
62
62
|
##
|
63
63
|
# Compiles the HTX template.
|
64
64
|
#
|
65
|
-
# * +assign_to+ - JavaScript object to assign the template function to (default:
|
65
|
+
# * +assign_to+ - JavaScript object to assign the template function to (default: +window+).
|
66
66
|
# * +indent+ - DEPRECATED. Indentation amount (number) or string (must be only spaces or tabs but not
|
67
67
|
# both) to use for indentation of compiled output (default: indentation of first indented line of
|
68
68
|
# uncompiled template).
|
@@ -173,7 +173,7 @@ module HTX
|
|
173
173
|
# Processes an element node.
|
174
174
|
#
|
175
175
|
# * +node+ - Nokogiri node to process.
|
176
|
-
# * +xmlns+ - True if node is the
|
176
|
+
# * +xmlns+ - True if node is the descendant of a node with an xmlns attribute.
|
177
177
|
#
|
178
178
|
def process_element_node(node, xmlns: false)
|
179
179
|
children = node.children
|
@@ -263,7 +263,7 @@ module HTX
|
|
263
263
|
# * +text+ - String to append to the compiled template string.
|
264
264
|
#
|
265
265
|
def append(text)
|
266
|
-
return
|
266
|
+
return if text.nil? || text.empty?
|
267
267
|
|
268
268
|
if @close_count > 0
|
269
269
|
close_count = @close_count
|
@@ -286,8 +286,6 @@ module HTX
|
|
286
286
|
|
287
287
|
flush if text.match?(NON_WHITESPACE)
|
288
288
|
@statement_buff << text
|
289
|
-
|
290
|
-
@compiled
|
291
289
|
end
|
292
290
|
|
293
291
|
##
|
@@ -311,8 +309,6 @@ module HTX
|
|
311
309
|
def flush
|
312
310
|
@compiled << @statement_buff
|
313
311
|
@statement_buff.clear
|
314
|
-
|
315
|
-
@compiled
|
316
312
|
end
|
317
313
|
|
318
314
|
##
|
@@ -369,7 +365,9 @@ module HTX
|
|
369
365
|
end
|
370
366
|
|
371
367
|
##
|
368
|
+
# Returns namespace URL of a Nokogiri node.
|
372
369
|
#
|
370
|
+
# * +node+ - Nokogiri node to get the namespace of.
|
373
371
|
#
|
374
372
|
def self.namespace(node)
|
375
373
|
node.namespace&.href || DEFAULT_XMLNS[node.name]
|
data/lib/htx/text_parser.rb
CHANGED
data/lib/htx/version.rb
CHANGED