oga 2.5 → 2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0bc73a2cb9eb839f4584dca06f27974a703a16e
4
- data.tar.gz: 738e73e658bc6c1f006c0900c8a36b564eaae34a
3
+ metadata.gz: 68bfeb927c46279d0f8c25b4bf9256823ce3f822
4
+ data.tar.gz: a32d15950c9bcc2417297890c19e2a90bcb591e2
5
5
  SHA512:
6
- metadata.gz: e6399a77ffbff1a43b83fe0e5906b4b8f7564a218e56c09db78cdf5ba8aaec9348249b18ce3e7f984f214255accfb9ae8c060369a7498af53747118a173ef327
7
- data.tar.gz: 473a67d7c03957929450f8908fcaafa62ede245c8e33825355f779d9c2cab74256e816e9f3ce990040dd07cf32e824a447e35c3bdf57a091cc6b555e0ec561bb
6
+ metadata.gz: 545b28f558f9c779ce36c01479224a1e784b4cebf555b82b599d3ea137db4aa75603af7f10bce7ef2355016d0639deeeaaba55f7ec772664c242c3fcac044e15
7
+ data.tar.gz: 70be276d071f8d9688f6186600f98bc967bc8dd00d13dc32303c0a15b3011e90396837b1142658161213f37d2839ed86c7c10da8b2d9adf37c44e9f15e229f87
@@ -2,8 +2,6 @@ body
2
2
  {
3
3
  font-size: 14px;
4
4
  line-height: 1.6;
5
- margin: 0 auto;
6
- max-width: 960px;
7
5
  }
8
6
 
9
7
  p code, dd code, li code
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '2.5'
2
+ VERSION = '2.6'
3
3
  end # Oga
@@ -13,7 +13,7 @@ module Oga
13
13
  #
14
14
  # @private
15
15
  class Generator
16
- # @param [Oga::XML::Document|Oga::XML::Node] start The node to serialise.
16
+ # @param [Oga::XML::Document|Oga::XML::Node] root The node to serialise.
17
17
  def initialize(root)
18
18
  @start = root
19
19
 
@@ -65,13 +65,20 @@ module Oga
65
65
 
66
66
  if child_node = children && current.children[0]
67
67
  current = child_node
68
+ elsif current == @start
69
+ # When we have reached the root node we should not process
70
+ # any of its siblings. If we did we'd include XML in the
71
+ # output from elements no part of the root node.
72
+ after_element(current, output) if current.is_a?(Element)
73
+
74
+ break
68
75
  else
69
76
  until next_node = current.is_a?(Node) && current.next
70
77
  if current.is_a?(Node) && current != @start
71
78
  current = current.parent
72
79
  end
73
80
 
74
- send(:after_element, current, output) if current.is_a?(Element)
81
+ after_element(current, output) if current.is_a?(Element)
75
82
 
76
83
  break if current == @start
77
84
  end
@@ -112,7 +119,7 @@ module Oga
112
119
  end
113
120
 
114
121
  # @param [Oga::XML::Element] element
115
- # @param [String] body The content of the element.
122
+ # @param [String] output The content of the element.
116
123
  def on_element(element, output)
117
124
  name = element.expanded_name
118
125
  attrs = ''
@@ -156,7 +163,7 @@ module Oga
156
163
  output << '>'
157
164
  end
158
165
 
159
- # @param [Oga::XML::Document] node
166
+ # @param [Oga::XML::Document] doc
160
167
  # @param [String] output
161
168
  def on_document(doc, output)
162
169
  if doc.xml_declaration
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.5'
4
+ version: '2.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-06 00:00:00.000000000 Z
11
+ date: 2016-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast