canon 0.3.86 → 0.3.87
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 +4 -4
- data/CLAUDE.md +1 -1
- data/README.adoc +5 -2
- data/lib/canon/comparison/html_parser.rb +0 -8
- data/lib/canon/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f8305566ebcb025deeeaf3a7493373c378ba4b62ef6895c0689ecfbb9ce751e
|
|
4
|
+
data.tar.gz: 58ba3679b7819da639da058fe82f7c9d14bd005bb33a8851f06ed654bbea66fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e65a54f2e878a4d1d073690bbda3fded68ca6e3546a8508f1623848905b0d28f1c32bffd88fe4eb4b573f084a566b98909ed4940ac23d8d0c65ccb7b4c7eae24
|
|
7
|
+
data.tar.gz: 11602849c2da9b9e53ac209b48c4b6faa8295f1e4c46f475f866449b7cfab83b7f04884caa8146dbdf8bbf4c7757bdcdabfbf33ef045f1ae067c712340c58bc1
|
data/CLAUDE.md
CHANGED
|
@@ -136,7 +136,7 @@ Canon is engine-agnostic across three seams (MECE — one concern per module):
|
|
|
136
136
|
|
|
137
137
|
- `Canon::XmlBackend` — XML engine selection. The default follows moxml's resolved adapter: **leptris whenever it is installed** (parse ~1.6x, serialize ~3.8x vs Nokogiri), raw Nokogiri otherwise (wrapping Nokogiri in moxml buys nothing — the wrapper adds 2-3x overhead). `:moxml` under Opal. `CANON_XML_BACKEND=nokogiri|moxml` forces either engine.
|
|
138
138
|
- `Canon::XmlParsing` — the only place that talks to engines for XML parse/serialize (moxml parses pass `readonly: true` — canon never mutates engine documents); node type queries answer for ANY recognized node (Nokogiri or moxml) by type, never by active backend — user-supplied Nokogiri nodes keep working under the moxml engine.
|
|
139
|
-
- `Canon::Html::NokogiriSupport` — HTML
|
|
139
|
+
- `Canon::Html::NokogiriSupport` — HTML engine seam. **HTML comparison parses through the engine** since 0.3.86: `HtmlParser.parse` routes through moxml `Context#parse_html_fragment` (WHATWG fragment parsing, moxml#353 riding leptris) and builds a Canon tree via the materialize-records fast path — whitespace text nodes survive the parse unconditionally (HTML whitespace significance is the comparison profile's decision, #112/#137), and `parse_node` walks Canon trees directly. The Nokogiri HTML4/HTML5 fragment path remains for runtimes without an engine HTML adapter and for user-supplied Nokogiri nodes. Nokogiri still serves the other HTML lanes: the pretty-printer's HTML5/fixture-ready display modes, the canonical HTML formatters, and the semantic lane's `DataModel.from_html`. The fragment-records lane once delivered nil URIs for prefixed attributes (moxml#367, fixed in moxml 0.5.130 — the bulk read now falls back to the reserved-prefix table); the TreeBuilder keeps the one legal `xml`-prefix binding as standing defense.
|
|
140
140
|
- `Canon::Xml::Sax` — SAX driver selection follows the resolved adapter: `MoxmlDriver` (leptris SAX — the comparison hot path, CI-gated in the split flip) under the leptris default, `NokogiriDriver` when the resolved adapter is nokogiri, `MoxmlDriver` under Opal. The builder (`SaxBuilder`) is engine-neutral.
|
|
141
141
|
|
|
142
142
|
Engine parity is complete through libleptris 1.9.8 / leptris-ruby 1.9.33 / moxml 0.5.12: attribute-value normalization, prolog/epilog PIs and comments, DTD ATTLIST defaults off by default (opt-in via `ParseOptions::DTDATTR`), PI-data whitespace matching libxml2, materialize with namespace declarations and a root-subtree-only record contract (moxml#140), readonly parse, deterministic `Document#free` (wired into `from_moxml_xml` — moxml#134). Canon's moxml conversion is record-based (`build_from_moxml` consumes `materialize` records — no per-node wrapper allocation; ~0.55x the Nokogiri conversion). `spec/canon/xml/engine_parity_spec.rb` is fully green. Pretty-printing runs the leptris serializer through `PrettyPrinter::Xml#moxml_format` (byte parity via moxml#153/#155/#156; the #167 escaping race fixed in 0.5.28), with Nokogiri serving the fallback engine and Opal — pretty-printed bytes are canon's product, gated by the fixture-integrity suite and the CI performance gate.
|
data/README.adoc
CHANGED
|
@@ -18,7 +18,8 @@ Key features:
|
|
|
18
18
|
* **Smart diff output**: By-line or by-object modes with syntax highlighting
|
|
19
19
|
* **Fast native engines, zero mandatory C deps**:
|
|
20
20
|
** XML on https://github.com/leptris/leptris[libleptris] (via moxml) whenever
|
|
21
|
-
installed — Nokogiri otherwise
|
|
21
|
+
installed — Nokogiri otherwise; HTML comparison parses through the engine's
|
|
22
|
+
WHATWG fragment mode. Both byte-compatible, engine
|
|
22
23
|
parity is spec-gated
|
|
23
24
|
** JSON on https://github.com/leptris/yeptris[libyeptris]' strict JSON surface
|
|
24
25
|
(yeptris is a required gem — platform gems, zero compilation)
|
|
@@ -974,7 +975,9 @@ bundle exec rake performance:yaml
|
|
|
974
975
|
Canon is engine-agnostic across its formats:
|
|
975
976
|
|
|
976
977
|
* **XML**: libleptris via moxml whenever installed (parse, comparison, C14N,
|
|
977
|
-
pretty-printing); raw Nokogiri otherwise
|
|
978
|
+
pretty-printing); raw Nokogiri otherwise. HTML comparison parses through the
|
|
979
|
+
engine's WHATWG fragment mode (Canon trees, since 0.3.86); Nokogiri serves
|
|
980
|
+
HTML display modes, canonical formatters, and the semantic data model.
|
|
978
981
|
`CANON_XML_BACKEND=nokogiri|moxml` forces either engine; parity between the
|
|
979
982
|
two is spec-gated (`spec/canon/xml/engine_parity_spec.rb`).
|
|
980
983
|
* **JSON**: yeptris' strict JSON surface when the native materializer is
|
|
@@ -65,14 +65,6 @@ module Canon
|
|
|
65
65
|
# element children convert through the materialize-records
|
|
66
66
|
# fast path; the wrapper walk serves the rare non-element
|
|
67
67
|
# top-level nodes (text, comments).
|
|
68
|
-
#
|
|
69
|
-
# NOTE: the fragment record buffer delivers a nil namespace
|
|
70
|
-
# URI for prefixed attributes on HTML-parsed trees (xml:lang
|
|
71
|
-
# arrives as name="lang", prefix="xml", uri=nil) where the
|
|
72
|
-
# wrapper API reports the bound URI — moxml#367. The TreeBuilder
|
|
73
|
-
# covers the xml prefix (the one legal binding); other
|
|
74
|
-
# foreign-content prefixes keep nil URIs on this lane until
|
|
75
|
-
# the records gap closes.
|
|
76
68
|
def engine_fragment(html)
|
|
77
69
|
frag = Canon::XmlParsing.moxml_context.parse_html_fragment(html)
|
|
78
70
|
root = Canon::Xml::Nodes::RootNode.new
|
data/lib/canon/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: canon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.87
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -44,28 +44,28 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.9.
|
|
47
|
+
version: 1.9.344
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.9.
|
|
54
|
+
version: 1.9.344
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: moxml
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.5.
|
|
61
|
+
version: 0.5.130
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 0.5.
|
|
68
|
+
version: 0.5.130
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: paint
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|