leptris 1.9.49-x86_64-linux → 1.9.50-x86_64-linux

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
  SHA256:
3
- metadata.gz: db5d7a945b1ae54ad6f41071e065ac76e281b5046c57c1cb287622cf56e5cfaa
4
- data.tar.gz: 26d1656cd92f748b696d5be108161f5a1d7cafe459cf1582ad223eb674df8ee3
3
+ metadata.gz: 82771f3b1186801c18c35e8a120077fb00b699848e3e1f416abb8745c7cba9eb
4
+ data.tar.gz: 2e5e709e74ec8e0b4885138f2566ac74559d855213917a5908d65e3f2bb5a104
5
5
  SHA512:
6
- metadata.gz: 3b7efbacf1d493e46a74ea0dca00fb38bc0930a15265f2c2806dc2021b6fd482a74181a5174d37f8bc2789f8975b3edc36367ebfaa49ed5219b467469c07f97f
7
- data.tar.gz: 43e35c6719b7d81e63e9ccb845792be27168c9ec98a4ae15ee11206b78c525ed67ea718c5f3dc066b84ca0166f65cdc09656128ba36fd16aa25945f7dde39b61
6
+ metadata.gz: ee78523e4b6a4226d6411b438a4170fcdcf4706699815cdbfa1a6c5a5f288fbd2c9f5580b3958853e07fa61927b9f0c84ae4b1ae20453fe179838f3d113760e7
7
+ data.tar.gz: 77d47c27d3b3a946c4d12cded1dd533a65cab50fa7f981de9c4743c2c2aa47d17a79a42b2f2f2a53b8fb3fcc74aaee07259e07928f30a5bf9878176aabb31741
data/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to Leptris will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.50] - 2026-09-01
9
+
10
+ ### Fixed
11
+
12
+ - **Copies keep comment and PI children (leptris-ruby#115)**:
13
+ `leptris_element_copy` silently drops COMMENT and PI children —
14
+ the C child-copy loop reads `/* Skip COMMENT and PI nodes for
15
+ now */` (engine-side, filed as leptris/leptris#696 with the
16
+ line). Blast radius in the binding: `Element#dup/#clone` and the
17
+ element indent-unit path both composed through the C copy. Both
18
+ now round through serialization instead — the serializer
19
+ preserves every child kind, prefixed names, and namespace
20
+ declarations, and re-parsing rebuilds them all; `dup` returns a
21
+ tree in a NEW document (unchanged contract), detached from the
22
+ original (spec-pinned).
23
+
8
24
  ## [1.9.49] - 2026-09-01
9
25
 
10
26
  ### Added
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.49"
4
+ VERSION = "1.9.50"
5
5
  end
@@ -251,10 +251,14 @@ class Leptris::XML::Element < Leptris::XML::Node
251
251
  self
252
252
  end
253
253
 
254
+ # Deep copy in a NEW document, via serialization round-trip:
255
+ # leptris_element_copy silently drops COMMENT and PI children
256
+ # (leptris/leptris#696, leptris-ruby#115) — the serializer
257
+ # preserves every child kind, prefixed names, and namespace
258
+ # declarations, and re-parsing rebuilds them all.
254
259
  def dup
255
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(@c_ptr, @document.c_ptr)
256
- raise Leptris::XML::Error, "leptris_element_copy failed" if copy_ptr.null?
257
- Leptris::XML::Node.wrap(copy_ptr, @document)
260
+ ensure_alive!
261
+ Leptris::XML::Document.parse(to_xml).root
258
262
  end
259
263
  alias_method :clone, :dup
260
264
 
@@ -369,13 +369,16 @@ class Leptris::XML::Node
369
369
  result
370
370
  end
371
371
 
372
+ # Deep copy in a NEW document. Rounds through serialization
373
+ # rather than leptris_element_copy: the C copy silently drops
374
+ # COMMENT and PI children (leptris/leptris#696, leptris-ruby#115)
375
+ # — the serializer preserves every child kind, prefixed names,
376
+ # and namespace declarations, and re-parsing rebuilds them all.
372
377
  def dup
373
378
  ensure_alive!
374
379
  elem_ptr = Leptris::XML::FFI.leptris_node_as_element(@c_ptr)
375
380
  raise Leptris::XML::Error, "dup is only supported for element nodes" if elem_ptr.null?
376
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(elem_ptr, @document.c_ptr)
377
- raise Leptris::XML::Error, "leptris_element_copy failed" if copy_ptr.null?
378
- Leptris::XML::Node.wrap(copy_ptr, @document)
381
+ Leptris::XML::Document.parse(to_xml).root
379
382
  end
380
383
  alias_method :clone, :dup
381
384
 
@@ -97,19 +97,15 @@ module Leptris::XML::Serialization
97
97
 
98
98
  # Element-face indent unit (leptris-ruby#109 residual 2): no
99
99
  # element-level ext-serialize entry exists yet, so the unit path
100
- # copies the element into a fresh document (C-side copy, one
101
- # pool allocation), serializes that document without a
102
- # declaration, and returns the subtree — identical output to the
103
- # element serializer for the standard layout, with the unit.
100
+ # rounds the subtree through serialization into a fresh document
101
+ # (leptris_element_copy drops COMMENT/PI children
102
+ # leptris/leptris#696, leptris-ruby#115) and serializes that
103
+ # document without a declaration identical output to the
104
+ # element serializer for the standard layout, with the unit and
105
+ # every child kind intact.
104
106
  def self.to_xml_element_unit(element, unit, indent: 0)
105
- document = Leptris::XML::Document.create
107
+ document = Leptris::XML::Document.parse(element.to_xml)
106
108
  begin
107
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(
108
- element.c_ptr, document.c_ptr)
109
- if copy_ptr.null?
110
- raise Leptris::XML::Error, "leptris_element_copy failed"
111
- end
112
- document.root = Leptris::XML::Node.wrap(copy_ptr, document)
113
109
  to_xml_indent_unit(document.c_ptr, unit,
114
110
  indent: indent, no_decl: true)
115
111
  ensure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.49
4
+ version: 1.9.50
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Ribose Inc.