oga 2.8 → 2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oga/version.rb +1 -1
- data/lib/oga/xml/doctype.rb +1 -3
- data/lib/oga/xml/document.rb +5 -0
- data/lib/oga/xml/generator.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50b5eac4cf1caefe82ec313588b10244f41d9d9e
|
4
|
+
data.tar.gz: 8384365d741110e61afb7a9010f4b792b418d286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c00fa4fbe27a8a31e655011190c7c87c9b7eddf54071e3c99d0fefe0b136f1ef7b8d6effdd20896f2b1f14eff28e4110b72e504dab406671b3624f008a88b1d3
|
7
|
+
data.tar.gz: fa02ff9fa46578343abc34c9f566a6d88e4e704348e4440f4b9b822c7dcd66ed03acc66ca4d663f04a8da7fc4a1434ca23e89f53e904dbe32d5199b3126bbdd4
|
data/lib/oga/version.rb
CHANGED
data/lib/oga/xml/doctype.rb
CHANGED
data/lib/oga/xml/document.rb
CHANGED
@@ -7,6 +7,11 @@ module Oga
|
|
7
7
|
include Traversal
|
8
8
|
include ToXML
|
9
9
|
|
10
|
+
# The doctype of the document.
|
11
|
+
#
|
12
|
+
# When parsing a document this attribute will be set automatically if a
|
13
|
+
# doctype resides at the root of the document.
|
14
|
+
#
|
10
15
|
# @return [Oga::XML::Doctype]
|
11
16
|
attr_accessor :doctype
|
12
17
|
|
data/lib/oga/xml/generator.rb
CHANGED
@@ -136,7 +136,9 @@ module Oga
|
|
136
136
|
end
|
137
137
|
|
138
138
|
if self_closing?(element)
|
139
|
-
|
139
|
+
closing_tag = html_void_element?(element) ? '>' : ' />'
|
140
|
+
|
141
|
+
output << "<#{name}#{attrs}#{closing_tag}"
|
140
142
|
else
|
141
143
|
output << "<#{name}#{attrs}>"
|
142
144
|
end
|
@@ -214,6 +216,10 @@ module Oga
|
|
214
216
|
element.children.empty?
|
215
217
|
end
|
216
218
|
end
|
219
|
+
|
220
|
+
def html_void_element?(element)
|
221
|
+
@html_mode && HTML_VOID_ELEMENTS.allow?(element.name)
|
222
|
+
end
|
217
223
|
end
|
218
224
|
end
|
219
225
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yorick Peterse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|