leptris 1.9.364.2 → 1.9.365.1
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/Rakefile +1 -1
- data/lib/leptris/vendor/aarch64-linux/libleptris.so +0 -0
- data/lib/leptris/vendor/aarch64-linux-musl/libleptris.so +0 -0
- data/lib/leptris/vendor/arm-linux/libleptris.so +0 -0
- data/lib/leptris/vendor/arm-linux-musl/libleptris.so +0 -0
- data/lib/leptris/vendor/arm64-darwin/libleptris.dylib +0 -0
- data/lib/leptris/vendor/ppc64le-linux/libleptris.so +0 -0
- data/lib/leptris/vendor/s390x-linux-musl/libleptris.so +0 -0
- data/lib/leptris/vendor/x86_64-darwin/libleptris.dylib +0 -0
- data/lib/leptris/vendor/x86_64-linux/libleptris.so +0 -0
- data/lib/leptris/vendor/x86_64-linux-musl/libleptris.so +0 -0
- data/lib/leptris/version.rb +1 -1
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +18 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/leptris/html/html_parse.c +13 -0
- data/vendor-src/libleptris/test/html/test_html_builder.cpp +40 -0
- data/vendor-src/libleptris/vcpkg.json +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: 973845563957861b68366fd3c90f3a8d3f1a5ba5921e09f2a2dc268542faa8b6
|
|
4
|
+
data.tar.gz: 71814d603d2c40586dc2e3c3aa9d36750e67a8cdb54864257a9f56cfa076a6c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f298b9d5e3ac0ffd299ee2323b4efcadddd2c7c7f09be765009c3764d99bbfeb88e3720a92888fbfda3195dfa5bededeca05e38c1790c7c2071fd87807718ed8
|
|
7
|
+
data.tar.gz: ea9086febdac6a55cb745ce9c240ed7ea2db9ac26843b6b1bfcca43c873a9fbcce1f522dff609ef83a8c62e9af98120d6e9dad18649ba0ec3ea77556c215d0cd
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.365"
|
|
12
12
|
# Vendored alongside libleptris for fn:normalize-unicode (TODO
|
|
13
13
|
# .restructure/20): built per platform with a RELOCATABLE @rpath
|
|
14
14
|
# install name, loaded by ffi.rb before libleptris so the
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/leptris/version.rb
CHANGED
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.365] - 2026-10-16
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **html4: skip the XML-declaration construct in HTML input (#1748, PR #1754).**
|
|
8
|
+
The html4 lane parsed `<?xml ...?>` as a PI node (target `xml`) whose data
|
|
9
|
+
carried the terminator `?`, so serialization emitted
|
|
10
|
+
`<?xml version="1.0" encoding="UTF-8"??>` — and with the serializer's
|
|
11
|
+
`xml_declaration` riding along (the default `to_xml`), the output carried
|
|
12
|
+
two declarations, which canon's XHTML pretty-printer degenerated to
|
|
13
|
+
declaration-only output downstream. libxml2's HTML parser skips the
|
|
14
|
+
XML-declaration construct entirely; the html4 lane now does the same (the
|
|
15
|
+
WHATWG lane keeps its specified bogus-comment shape). Red-first gtest pins
|
|
16
|
+
the contract: `xml_declaration=0` emits no declaration, `1` emits exactly
|
|
17
|
+
the serializer's own — never the input's remnant, never `??`. Engine suite
|
|
18
|
+
2047/2047; canon's battery 9/9.
|
|
19
|
+
|
|
20
|
+
|
|
3
21
|
## [1.9.364] - 2026-10-16
|
|
4
22
|
|
|
5
23
|
### Added
|
|
@@ -6685,6 +6685,19 @@ static LeptrisDocument html_parse_shared(
|
|
|
6685
6685
|
size_t dlen = (size_t)(de > ds ? de - ds : 0);
|
|
6686
6686
|
char* tgt = (char*)leptris_pool_alloc(b.pool, tlen + 1);
|
|
6687
6687
|
char* dat = (char*)leptris_pool_alloc(b.pool, dlen + 1);
|
|
6688
|
+
/* libxml2 HTML parity (#1748): the XML-declaration
|
|
6689
|
+
* construct ('<?xml ...?>') is an XML-ism — the HTML
|
|
6690
|
+
* lane skips it entirely. Retaining it as a PI made the
|
|
6691
|
+
* data carry the terminator '?' (serialized
|
|
6692
|
+
* '<?xml ...??>'), and the declaration metadata + PI
|
|
6693
|
+
* doubled when the serializer's xml_declaration rode
|
|
6694
|
+
* along. */
|
|
6695
|
+
if (tlen == 3 && (ts[0] | 0x20) == 'x' &&
|
|
6696
|
+
(ts[1] | 0x20) == 'm' && (ts[2] | 0x20) == 'l') {
|
|
6697
|
+
p = (de < end) ? de + 1 : end;
|
|
6698
|
+
text = p;
|
|
6699
|
+
continue;
|
|
6700
|
+
}
|
|
6688
6701
|
if (tgt && dat) {
|
|
6689
6702
|
memcpy(tgt, ts, tlen);
|
|
6690
6703
|
tgt[tlen] = 0;
|
|
@@ -188,3 +188,43 @@ TEST(HtmlBuilder, RawTextElementNotEscaped) {
|
|
|
188
188
|
EXPECT_EQ(out.find("<"), std::string::npos) << out;
|
|
189
189
|
leptris_document_free(d);
|
|
190
190
|
}
|
|
191
|
+
|
|
192
|
+
/* leptris#1748: the XML-declaration construct ('<?xml ...?>') in
|
|
193
|
+
* HTML input is an XML-ism — libxml2's HTML parser skips it, and
|
|
194
|
+
* retaining it as a PI (data carrying the terminator '?') made
|
|
195
|
+
* serialization emit '<?xml ...??>' and double the declaration when
|
|
196
|
+
* the serializer's own xml_declaration rode along. */
|
|
197
|
+
TEST(HtmlBuilder, Html4DropsXmlDeclarationProlog) {
|
|
198
|
+
const char* html =
|
|
199
|
+
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
|
200
|
+
"<html xmlns=\"http://www.w3.org/1999/xhtml\">"
|
|
201
|
+
"<head><title>t</title></head><body><p>x</p></body></html>";
|
|
202
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
203
|
+
LeptrisDocument d =
|
|
204
|
+
leptris_parse_html4_string(html, strlen(html), &st);
|
|
205
|
+
ASSERT_EQ(st, LEPTRIS_OK);
|
|
206
|
+
ASSERT_NE(d, nullptr);
|
|
207
|
+
for (int decl = 0; decl < 2; decl++) {
|
|
208
|
+
LeptrisSerializeOptions opts;
|
|
209
|
+
memset(&opts, 0, sizeof(opts));
|
|
210
|
+
opts.xml_declaration = decl;
|
|
211
|
+
opts.encoding = "UTF-8";
|
|
212
|
+
char* s = leptris_document_serialize(d, &opts);
|
|
213
|
+
ASSERT_NE(s, nullptr);
|
|
214
|
+
std::string out(s);
|
|
215
|
+
leptris_free_string(s);
|
|
216
|
+
EXPECT_EQ(out.find("??"), std::string::npos)
|
|
217
|
+
<< "decl=" << decl << " got: " << out.substr(0, 90);
|
|
218
|
+
/* decl=0: the prolog never leaks. decl=1: exactly the
|
|
219
|
+
* serializer's own declaration — never two, never the
|
|
220
|
+
* input's remnant. */
|
|
221
|
+
size_t decls = 0;
|
|
222
|
+
for (size_t at = out.find("<?xml"); at != std::string::npos;
|
|
223
|
+
at = out.find("<?xml", at + 1))
|
|
224
|
+
decls++;
|
|
225
|
+
EXPECT_EQ(decls, (size_t)decl)
|
|
226
|
+
<< "decl=" << decl << " got: " << out.substr(0, 90);
|
|
227
|
+
EXPECT_NE(out.find("<html"), std::string::npos) << out;
|
|
228
|
+
}
|
|
229
|
+
leptris_document_free(d);
|
|
230
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
3
3
|
"name": "leptris",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.365",
|
|
5
5
|
"description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
|
|
6
6
|
"homepage": "https://github.com/leptris/leptris",
|
|
7
7
|
"license": "MIT",
|