moxml 0.5.141 → 0.5.142

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: abd0d17dd69910a5dae8f2d65355b52210ac11864e21a01c69309f7617d1d3ef
4
- data.tar.gz: 2b593dba220399f60c9d95f043333d093bb84f43d5089cdfc39229559a43620c
3
+ metadata.gz: 2c55a66ba735b6d8f170ad9f83a95faeb16717520d2fd30f767e1dc56914914b
4
+ data.tar.gz: 74f3c07cdccc077e78fbef88d9d8e8f83310f5f9cdc1175221bf719a3a864146
5
5
  SHA512:
6
- metadata.gz: 0f3649cf4b8b95c0a3e74dc52c9f848efd9686e05e8eac7d76280ac2b1efc2c27c1cc8da1ee0c6cdaf4f53a2b5c98d8aa0703418c0aee06f1887620f8cbb89d7
7
- data.tar.gz: 797ec99ff45da619f5c2d859d06dd23d9bd95d1d03d98b224ba9fd281112746b303d9424c4d474711e881ee002b298a494970c9fef4b690c91badf18f24cb723
6
+ metadata.gz: 2b8a163b9601f4da9d2c9a96b1d5ef35eb0d874c27ec5d6c608283cd7ca27c9d801fa9065724a8989406423bd0844100d914cb2ee0de07a2a8f51f0212eb4ab4
7
+ data.tar.gz: 153852b30839c08744fbd29558af04ba07a1c7c27979fa5cfd0ab6fbf48185a1186a33b7989b4aaf07e477942a3c9c215aa6b25b9225dff5670def94a71aa563
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.141"
4
+ VERSION = "0.5.142"
5
5
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ # moxml#389: a comment token following ignored <html>/<body> start
6
+ # tags inserts at the current node (WHATWG 13.2.6.4.4 in-body
7
+ # comment insertion) — the ignored structural start tags do not
8
+ # change where comments land, and canon's strict-comments HTML
9
+ # comparisons ride the surface. Engine-side fix: leptris#1769
10
+ # (v1.9.370.1); the fragment path always wraps with <body>, so the
11
+ # in-body window gates apply.
12
+ RSpec.describe "parse_html_fragment comment preservation" do
13
+ let(:ctx) { Moxml.new(:leptris) }
14
+
15
+ before do
16
+ unless Gem::Version.new(Leptris::VERSION) >= Gem::Version.new("1.9.370.1")
17
+ skip "binding #{Leptris::VERSION} predates the in-body comment " \
18
+ "fix (engine 1.9.370.1)"
19
+ end
20
+ end
21
+
22
+ it "keeps a comment after ignored html/body start tags" do
23
+ frag = ctx.parse_html_fragment(
24
+ "<html><body><!-- c --><p>Test</p></body></html>",
25
+ )
26
+ kinds = frag.children.map { |c| c.class.name.split("::").last }
27
+ expect(kinds).to include("Comment")
28
+ end
29
+
30
+ it "keeps the top-level comment shape unchanged" do
31
+ frag = ctx.parse_html_fragment("<!-- c --><p>Test</p>")
32
+ kinds = frag.children.map { |c| c.class.name.split("::").last }
33
+ expect(kinds).to eq(%w[Comment Element])
34
+ end
35
+
36
+ it "round-trips the comment through serialization" do
37
+ frag = ctx.parse_html_fragment(
38
+ "<html><body><!-- c --><p>Test</p></body></html>",
39
+ )
40
+ expect(frag.to_html).to include("<!-- c -->")
41
+ end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.141
4
+ version: 0.5.142
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-17 00:00:00.000000000 Z
11
+ date: 2026-10-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Moxml is a unified XML manipulation library that provides a common API
@@ -454,6 +454,7 @@ files:
454
454
  - spec/moxml/adapter/leptris_binding_cap_spec.rb
455
455
  - spec/moxml/adapter/leptris_doc_parts_spec.rb
456
456
  - spec/moxml/adapter/leptris_document_declaration_spec.rb
457
+ - spec/moxml/adapter/leptris_inbody_comment_spec.rb
457
458
  - spec/moxml/adapter/leptris_parse_skips_spec.rb
458
459
  - spec/moxml/adapter/leptris_record_driver_spec.rb
459
460
  - spec/moxml/adapter/leptris_sax_dup_attr_spec.rb