dom 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dom.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e1219b93b5c18c22d26821c1092a089ee00a5a4
|
4
|
+
data.tar.gz: 96a575a9fa9ce3159d78f72932abdb2aa1fef53f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7155b243a44e0614bda027debd95dff6b6d2a05192772d9a53e7337ca36a89b64b7a88cbf1dd7239a8f97b114fe1e21786e36df3d487ce99d9c5604583296b3c
|
7
|
+
data.tar.gz: 359b50537f6b7c485d00594bb706b6e53ab21fea812d2ba3417e0feb6f3c98a31c1b5e0b76ca9b48e46cfd1828ee7c1a94d007c28b29106ce1526df350e19e6f
|
data/lib/dom.rb
CHANGED
@@ -3,7 +3,7 @@ require "stringio"
|
|
3
3
|
require "strscan"
|
4
4
|
|
5
5
|
class File
|
6
|
-
def self.relativize f; f.sub(%r{\A/}, "".freeze) end
|
6
|
+
def self.relativize f; f.sub(%r{\A/}o, "".freeze) end
|
7
7
|
end
|
8
8
|
|
9
9
|
module Dom
|
@@ -15,10 +15,10 @@ module Dom
|
|
15
15
|
a.map{|e| e.to_s.escape_html(tag)}.join(s)
|
16
16
|
end
|
17
17
|
def self.join_nested a, tag
|
18
|
-
"#$/#{join_compact(a, tag, $/).gsub(
|
18
|
+
"#$/#{join_compact(a, tag, $/).gsub(/^/o, " ".freeze)}#$/"
|
19
19
|
end
|
20
20
|
def self.join_pre a, tag
|
21
|
-
"<!--#$/#{"-->#{join_compact(a, tag, "<!--#$/-->".freeze)}<!--".gsub(
|
21
|
+
"<!--#$/#{"-->#{join_compact(a, tag, "<!--#$/-->".freeze)}<!--".gsub(/^/o, " ".freeze)}#$/-->"
|
22
22
|
end
|
23
23
|
def self.attr h; h.map{|k, v| " #{hyphenize(k)}=\"#{v}\""}.join end
|
24
24
|
def self.json_attr h; h.map{|k, v| [hyphenize(k), v]}.to_h end
|