canon 0.3.81 → 0.3.83
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/pretty_printer/html.rb +15 -7
- data/lib/canon/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4fd3055b37e95e61ad3a0ae681f7ff189110e0c165d16eeb8cc8a5622c4d0c90
|
|
4
|
+
data.tar.gz: 8fe029c9c738bd420d00987c1d3294135d3ba2e0c887ce79d776d2174a200cea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 458b046a6f3d1fcff7e3ee1cbb3dd8440410f50235f150752dda31c553c4381851483f957f8ac156a60e02b2a6fb2835d07a33a61d2eefa9a556bd3ed83fbfb4
|
|
7
|
+
data.tar.gz: 0c728faa6b73f461130ca780ee29d360e4ea71a64e723a990d488a677e161692e8ab4e65a903f8788ef9ff10dda749589b63386aeb8c93f372e1a6c3449f2a77
|
|
@@ -53,14 +53,22 @@ module Canon
|
|
|
53
53
|
html_string.include?('xmlns="http://www.w3.org/1999/xhtml"')
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
# XHTML is XML: the shared XML pretty-printer lane owns it (the
|
|
57
|
+
# leptris serializer under the default engine — Nokogiri serving
|
|
58
|
+
# only the forced-fallback engine), keeping the XML loud/tolerant
|
|
59
|
+
# parse contract and the engine's byte-faithful serializer.
|
|
60
|
+
#
|
|
61
|
+
# This replaces a direct Nokogiri::XML call whose serializer
|
|
62
|
+
# INJECTED a <meta http-equiv="Content-Type"> element into <head>
|
|
63
|
+
# of XHTML PUBLIC-doctype documents at serialization time — a
|
|
64
|
+
# pretty-printer must never invent content. Intentional byte
|
|
65
|
+
# changes vs the Nokogiri lane: the phantom meta is gone;
|
|
66
|
+
# body-level PIs/comments indent like every other child; void
|
|
67
|
+
# elements self-close without a space (<br/>).
|
|
56
68
|
def format_as_xhtml(html_string)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
doc.to_xml(indent: 1, indent_text: "\t", encoding: "UTF-8")
|
|
61
|
-
else
|
|
62
|
-
doc.to_xml(indent: @indent, encoding: "UTF-8")
|
|
63
|
-
end
|
|
69
|
+
out = Canon::PrettyPrinter::Xml.new(
|
|
70
|
+
indent: @indent, indent_type: @indent_type,
|
|
71
|
+
).format(html_string)
|
|
64
72
|
|
|
65
73
|
expand_non_void_self_closing(out)
|
|
66
74
|
end
|
data/lib/canon/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.83
|
|
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-
|
|
11
|
+
date: 2026-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diff-lcs
|
|
@@ -44,28 +44,28 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.9.
|
|
47
|
+
version: 1.9.336
|
|
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.336
|
|
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.122
|
|
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.122
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: paint
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,16 +112,16 @@ dependencies:
|
|
|
112
112
|
name: thor
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- - "
|
|
115
|
+
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '
|
|
117
|
+
version: '1.4'
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- - "
|
|
122
|
+
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '
|
|
124
|
+
version: '1.4'
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: unicode-name
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -142,14 +142,14 @@ dependencies:
|
|
|
142
142
|
requirements:
|
|
143
143
|
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 0.6.
|
|
145
|
+
version: 0.6.32
|
|
146
146
|
type: :runtime
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 0.6.
|
|
152
|
+
version: 0.6.32
|
|
153
153
|
description: |-
|
|
154
154
|
Canon provides canonicalization and pretty-printing for various serialization
|
|
155
155
|
formats (XML, HTML, JSON, YAML), producing standardized forms suitable for
|