canon 0.3.97 → 0.3.98
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/lib/canon/comparison/html_comparator.rb +12 -1
- data/lib/canon/comparison/html_parser.rb +5 -2
- data/lib/canon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07c9d8c96426b670ad088e3b96e662b45283c4868e99c27a5afb5a6ecb537780
|
|
4
|
+
data.tar.gz: 5e8bc5ee7aa5b1e1b75b158d1afc68f3035e1c58bcd3da4624fdebbbbc83b4a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 813b81bd8fe090e71c9729d18326e864b0af54129e422ae4d624676ed8e191f6b2b278e5dab5e00c1827fccaed9658e5bd85a9ef6ac908c9e0cc4ff97d33839e
|
|
7
|
+
data.tar.gz: 6819b9252b0e6f27efec816241b1444d1ff92456562996ddc0c89a8f07b04eb41d48302025fda8776581437fb793da24db3ed21fec2b1589522c0680739bd99c
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "set"
|
|
4
|
-
Canon::NokogiriLoader.require!("HTML comparison")
|
|
5
4
|
|
|
6
5
|
module Canon
|
|
7
6
|
module Comparison
|
|
@@ -383,6 +382,18 @@ module Canon
|
|
|
383
382
|
node
|
|
384
383
|
end
|
|
385
384
|
|
|
385
|
+
# Direct comparator calls parse through the legacy XML-fragment
|
|
386
|
+
# lane: both sides of a comparison must land on the SAME tree
|
|
387
|
+
# shape, and a string paired with a user-supplied Nokogiri node
|
|
388
|
+
# must take the Nokogiri path. The pipeline preparse converts
|
|
389
|
+
# string PAIRS through the engine lane (HtmlParser.parse), so
|
|
390
|
+
# user-facing comparisons run engine-served either way.
|
|
391
|
+
# NOTE: the engine fragment parse currently drops comments
|
|
392
|
+
# that follow ignored <html>/<body> start tags (filed
|
|
393
|
+
# upstream — moxml#389) — the pipeline lane's comment
|
|
394
|
+
# handling for strict comments rides that fix.
|
|
395
|
+
Canon::NokogiriLoader.require!("the HTML comparison legacy lane")
|
|
396
|
+
|
|
386
397
|
frag = Html::NokogiriSupport.xml_fragment(
|
|
387
398
|
decode_html_named_entities(html_string),
|
|
388
399
|
)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
Canon::NokogiriLoader.require!("HTML comparison")
|
|
4
|
-
|
|
5
3
|
module Canon
|
|
6
4
|
module Comparison
|
|
7
5
|
# HTML parsing service with version detection and fragment support
|
|
@@ -39,6 +37,11 @@ module Canon
|
|
|
39
37
|
|
|
40
38
|
return engine_fragment(content) if engine_html_fragments?
|
|
41
39
|
|
|
40
|
+
# Nokogiri fallback lane (runtimes without the engine HTML
|
|
41
|
+
# surface): Nokogiri is required lazily, at use — the engine
|
|
42
|
+
# lane above keeps HTML comparison nokogiri-less.
|
|
43
|
+
Canon::NokogiriLoader.require!("the HTML fallback lane")
|
|
44
|
+
|
|
42
45
|
begin
|
|
43
46
|
case format
|
|
44
47
|
when :html5
|
data/lib/canon/version.rb
CHANGED