leptris 1.9.376.0 → 1.9.377.0
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 +21 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/leptris/html/html_parse.c +130 -13
- data/vendor-src/libleptris/test/html/test_html5lib.cpp +10 -2
- 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: eaa5ce5dfd171e7a4931f40dcd4ec8e901bd4895f20776df74daee75595e2294
|
|
4
|
+
data.tar.gz: d843a2dac00c737e4e203ea1375f0575fd1df0ec2b854ad0134e87bfcad3493f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d81ecd1df498f7fd65db0531affc0a61ab9df1f79123a19b05759c77d0a64c91299e771a2b314347a3565a3f721b63685b01723f7afa21e40063eb94a2c0774
|
|
7
|
+
data.tar.gz: 1aa12f5eaad5f1566a9cc2b070f09db64433714ced23cdac8c16a1d34056b2f43748b45fecdbc8c590a1084e694cd8ec38549af406e8e68aee9e69d9203edec1
|
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.377"
|
|
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,26 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.377] - 2026-10-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **html: verdict parity 1508 to 1532 of 1555 (PR #1797).** Five
|
|
8
|
+
emission slices, each grounded in html5lib's parser/tokenizer
|
|
9
|
+
source and gated by the #1771 corpus harness with zero want=clean
|
|
10
|
+
regressions: misplaced in-body caption/col/…/tr and `<frame>`
|
|
11
|
+
(unexpected-start-tag-ignored) plus the stray `</p>` phase codes;
|
|
12
|
+
after-html/after-body/after-frameset character codes
|
|
13
|
+
(expected-eof-but-got-char, unexpected-char-after-body,
|
|
14
|
+
unexpected-char-after-frameset); unterminated-comment tokenizer
|
|
15
|
+
codes (eof-in-comment, eof-in-comment-double-dash);
|
|
16
|
+
plaintext-at-EOF and the `</` tokenizer EOF codes; and a
|
|
17
|
+
phase-aware depth-0 stray-end-tag branch covering raw-text names,
|
|
18
|
+
void elements and menuitem (end-tag-after-implied-root before
|
|
19
|
+
html, after-body/-frameset/after-html variants, otherwise
|
|
20
|
+
unexpected-end-tag). Tree parity stays 1555/1555; the verdict
|
|
21
|
+
floor rose from 1508 to 1532.
|
|
22
|
+
|
|
23
|
+
|
|
3
24
|
## [1.9.376] - 2026-10-20
|
|
4
25
|
|
|
5
26
|
### Fixed
|
|
@@ -4035,6 +4035,13 @@ static void h_append(HBuilder* b, LeptrisNodeRef n) {
|
|
|
4035
4035
|
if (*q != ' ' && *q != '\t' && *q != '\n' &&
|
|
4036
4036
|
*q != '\r') { ws = 0; break; }
|
|
4037
4037
|
if (!ws) {
|
|
4038
|
+
/* AfterFrameset processCharacters reports
|
|
4039
|
+
* unexpected-char-after-frameset; the after-</html>
|
|
4040
|
+
* flavor is reported by the expected-eof block below. */
|
|
4041
|
+
if (!b->after_html)
|
|
4042
|
+
h_diag(b, "unexpected-char-after-frameset",
|
|
4043
|
+
b->err_line_memo_off,
|
|
4044
|
+
"characters after </frameset>");
|
|
4038
4045
|
/* Every whitespace character inserts, every
|
|
4039
4046
|
* non-whitespace one drops (tests2:7: " te st" ->
|
|
4040
4047
|
* " "). Filter in place, like after-frameset. */
|
|
@@ -4057,7 +4064,20 @@ static void h_append(HBuilder* b, LeptrisNodeRef n) {
|
|
|
4057
4064
|
for (const char* q = tt; *q; q++)
|
|
4058
4065
|
if (*q != ' ' && *q != '\t' && *q != '\n' &&
|
|
4059
4066
|
*q != '\r') { nonws = 1; break; }
|
|
4060
|
-
if (nonws)
|
|
4067
|
+
if (nonws) {
|
|
4068
|
+
b->after_body_done = 1;
|
|
4069
|
+
/* AfterAfterBody/AfterAfterFrameset processCharacters
|
|
4070
|
+
* report expected-eof-but-got-char; AfterBody reports
|
|
4071
|
+
* unexpected-char-after-body (tests2:55, tests19:41). */
|
|
4072
|
+
if (b->after_html)
|
|
4073
|
+
h_diag(b, "expected-eof-but-got-char",
|
|
4074
|
+
b->err_line_memo_off,
|
|
4075
|
+
"characters after </html>");
|
|
4076
|
+
else
|
|
4077
|
+
h_diag(b, "unexpected-char-after-body",
|
|
4078
|
+
b->err_line_memo_off,
|
|
4079
|
+
"characters after </body>");
|
|
4080
|
+
}
|
|
4061
4081
|
}
|
|
4062
4082
|
/* Doc-start mixed run: the ws prefix is "before html"
|
|
4063
4083
|
* whitespace and drops (doctype01:31, tests19:79). Tightest
|
|
@@ -5797,12 +5817,25 @@ static LeptrisDocument html_parse_shared(
|
|
|
5797
5817
|
size_t clen = cclose
|
|
5798
5818
|
? (size_t)(ce - cs)
|
|
5799
5819
|
: (size_t)(end - cs);
|
|
5800
|
-
if (!cclose)
|
|
5820
|
+
if (!cclose) {
|
|
5821
|
+
/* Tokenizer EOF states: a trailing "--" is
|
|
5822
|
+
* comment-end-double-dash (tests2:59), anything
|
|
5823
|
+
* else is a plain eof-in-comment (tests2:35/43). */
|
|
5824
|
+
if (b.whatwg) {
|
|
5825
|
+
int dd = clen >= 2 && cs[clen - 1] == '-' &&
|
|
5826
|
+
cs[clen - 2] == '-';
|
|
5827
|
+
h_diag(&b,
|
|
5828
|
+
dd ? "eof-in-comment-double-dash"
|
|
5829
|
+
: "eof-in-comment",
|
|
5830
|
+
(size_t)(end - b.input_base),
|
|
5831
|
+
"comment reaches end of input");
|
|
5832
|
+
}
|
|
5801
5833
|
/* Unterminated at EOF: html5lib drops the
|
|
5802
5834
|
* trailing dash run (tests2:59: <!--x-- keeps
|
|
5803
5835
|
* data "x"). */
|
|
5804
5836
|
while (clen > 0 && cs[clen - 1] == '-')
|
|
5805
5837
|
clen--;
|
|
5838
|
+
}
|
|
5806
5839
|
p = cclose ? ce + cclose : end;
|
|
5807
5840
|
LeptrisCommentNode* c = leptris_comment_create(
|
|
5808
5841
|
cs, clen, b.pool);
|
|
@@ -6111,6 +6144,18 @@ static LeptrisDocument html_parse_shared(
|
|
|
6111
6144
|
{
|
|
6112
6145
|
const char* ns2 = p + 2;
|
|
6113
6146
|
if (b.whatwg && ns2 >= end) {
|
|
6147
|
+
/* Tokenizer: EOF in the tag-open state emits
|
|
6148
|
+
* expected-closing-tag-but-got-eof and the two
|
|
6149
|
+
* characters as text (tests1:38); in the
|
|
6150
|
+
* initial mode that text also reports the
|
|
6151
|
+
* missing doctype. */
|
|
6152
|
+
h_diag(&b, "expected-closing-tag-but-got-eof",
|
|
6153
|
+
(size_t)(p - b.input_base),
|
|
6154
|
+
"end tag at end of input");
|
|
6155
|
+
if (!b.left_initial && !doc->doctype)
|
|
6156
|
+
h_diag(&b, "expected-doctype-but-got-chars",
|
|
6157
|
+
(size_t)(p - b.input_base),
|
|
6158
|
+
"characters in the initial mode");
|
|
6114
6159
|
if (text < p) {
|
|
6115
6160
|
LeptrisTextNode* t =
|
|
6116
6161
|
h_text_node(&b, text, p);
|
|
@@ -6259,21 +6304,35 @@ static LeptrisDocument html_parse_shared(
|
|
|
6259
6304
|
text = p;
|
|
6260
6305
|
continue;
|
|
6261
6306
|
}
|
|
6262
|
-
/* Stray
|
|
6263
|
-
*
|
|
6264
|
-
*
|
|
6265
|
-
* endTagOther reports
|
|
6266
|
-
*
|
|
6267
|
-
*
|
|
6268
|
-
*
|
|
6269
|
-
if (b.whatwg && nlen && b.depth == 0
|
|
6307
|
+
/* Stray end tags with no open stack. The raw-text family
|
|
6308
|
+
* completes during start-tag handling; void elements and
|
|
6309
|
+
* menuitem have no in-body end handler. html5lib's
|
|
6310
|
+
* endTagOther reports by phase: before-html is
|
|
6311
|
+
* end-tag-after-implied-root; AfterBody/AfterFrameset
|
|
6312
|
+
* and AfterAfter* have their own codes; InHead/InBody/
|
|
6313
|
+
* AfterHead report unexpected-end-tag. */
|
|
6314
|
+
if (b.whatwg && nlen && b.depth == 0) {
|
|
6270
6315
|
char rn[16];
|
|
6271
6316
|
size_t rl = nlen < sizeof(rn) - 1 ? nlen : sizeof(rn) - 1;
|
|
6272
6317
|
for (size_t i = 0; i < rl; i++) rn[i] = h_lower(ns[i]);
|
|
6273
6318
|
rn[rl] = 0;
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6319
|
+
int stray = h_is_rawtext_name(rn) ||
|
|
6320
|
+
(h_is_void(rn) && strcmp(rn, "br") != 0) ||
|
|
6321
|
+
strcmp(rn, "menuitem") == 0;
|
|
6322
|
+
if (stray) {
|
|
6323
|
+
const char* code = "unexpected-end-tag";
|
|
6324
|
+
if (b.after_html)
|
|
6325
|
+
code = "expected-eof-but-got-end-tag";
|
|
6326
|
+
else if (b.after_body)
|
|
6327
|
+
code = "unexpected-end-tag-after-body";
|
|
6328
|
+
else if (b.frameset && b.after_frameset)
|
|
6329
|
+
code = "unexpected-end-tag-after-frameset";
|
|
6330
|
+
else if (b.frameset)
|
|
6331
|
+
code = "unexpected-end-tag-in-frameset";
|
|
6332
|
+
else if (!b.top_tail && !b.head_tag_seen &&
|
|
6333
|
+
!b.body_seen && !b.body_tag_seen)
|
|
6334
|
+
code = "end-tag-after-implied-root";
|
|
6335
|
+
h_diag(&b, code, (size_t)(p - b.input_base),
|
|
6277
6336
|
"</%s> has no matching open element", rn);
|
|
6278
6337
|
p = q;
|
|
6279
6338
|
text = p;
|
|
@@ -6295,6 +6354,19 @@ static LeptrisDocument html_parse_shared(
|
|
|
6295
6354
|
for (size_t i = 0; i < cl; i++)
|
|
6296
6355
|
lname[i] = h_lower(ns[i]);
|
|
6297
6356
|
lname[cl] = 0;
|
|
6357
|
+
/* InBody endTagOther: a VOID element has no end
|
|
6358
|
+
* handler, so a stray end tag reports
|
|
6359
|
+
* unexpected-end-tag (tests25:15-20: </keygen>).
|
|
6360
|
+
* </br> is endTagBr and acts as <br> above. */
|
|
6361
|
+
if (b.whatwg && h_is_void(lname) &&
|
|
6362
|
+
strcmp(lname, "br") != 0) {
|
|
6363
|
+
h_diag(&b, "unexpected-end-tag",
|
|
6364
|
+
(size_t)(p - b.input_base),
|
|
6365
|
+
"</%s> is a void element", lname);
|
|
6366
|
+
p = q;
|
|
6367
|
+
text = p;
|
|
6368
|
+
continue;
|
|
6369
|
+
}
|
|
6298
6370
|
if (!h_is_void(lname)) {
|
|
6299
6371
|
if (b.whatwg &&
|
|
6300
6372
|
strcmp(lname, "menuitem") == 0) {
|
|
@@ -6433,6 +6505,16 @@ static LeptrisDocument html_parse_shared(
|
|
|
6433
6505
|
(size_t)(p - b.input_base),
|
|
6434
6506
|
"</%s> with no open heading", lname);
|
|
6435
6507
|
}
|
|
6508
|
+
/* InHead/AfterHead endTagOther: a </p> before
|
|
6509
|
+
* body content is dropped with unexpected-end-tag
|
|
6510
|
+
* and inserts nothing (tests19:3). */
|
|
6511
|
+
if (b.whatwg && strcmp(lname, "p") == 0 &&
|
|
6512
|
+
!b.body_seen && (b.head_tag_seen ||
|
|
6513
|
+
b.head_end_seen) &&
|
|
6514
|
+
!b.frameset && !b.after_body && !b.after_html)
|
|
6515
|
+
h_diag(&b, "unexpected-end-tag",
|
|
6516
|
+
(size_t)(p - b.input_base),
|
|
6517
|
+
"</p> outside the body phase");
|
|
6436
6518
|
/* #659 13.2.6.4.17: </p> with no p in button
|
|
6437
6519
|
* scope inserts an EMPTY <p> and closes it
|
|
6438
6520
|
* (tests1:29) — the stray tag still leaves a
|
|
@@ -6460,6 +6542,13 @@ static LeptrisDocument html_parse_shared(
|
|
|
6460
6542
|
break;
|
|
6461
6543
|
}
|
|
6462
6544
|
if (!p_open) {
|
|
6545
|
+
/* InBody endTagP: no p in button scope
|
|
6546
|
+
* is a parse error even though the
|
|
6547
|
+
* empty p is still inserted
|
|
6548
|
+
* (tests2:60). */
|
|
6549
|
+
h_diag(&b, "unexpected-end-tag",
|
|
6550
|
+
(size_t)(p - b.input_base),
|
|
6551
|
+
"</p> with no p in scope");
|
|
6463
6552
|
LeptrisElement pe =
|
|
6464
6553
|
h_open_element(&b, "p");
|
|
6465
6554
|
(void)pe;
|
|
@@ -7694,6 +7783,13 @@ static LeptrisDocument html_parse_shared(
|
|
|
7694
7783
|
}
|
|
7695
7784
|
}
|
|
7696
7785
|
if (!tbl_ctx) {
|
|
7786
|
+
/* InBody startTagMisplaced: caption/col/colgroup/
|
|
7787
|
+
* head/tbody/td/tfoot/th/thead/tr in body is a
|
|
7788
|
+
* parse error and the token is ignored
|
|
7789
|
+
* (tests25:7 <body><col>A). */
|
|
7790
|
+
h_diag(&b, "unexpected-start-tag-ignored",
|
|
7791
|
+
(size_t)(p - b.input_base),
|
|
7792
|
+
"<%s> ignored in the body phase", name);
|
|
7697
7793
|
/* The TOKEN is ignored - surrounding character
|
|
7698
7794
|
* tokens keep flowing into body (the html-merge
|
|
7699
7795
|
* flush pattern). */
|
|
@@ -7712,6 +7808,20 @@ static LeptrisDocument html_parse_shared(
|
|
|
7712
7808
|
* an ignored <frameset> vanishes). */
|
|
7713
7809
|
if (b.whatwg && strcmp(name, "frame") == 0 &&
|
|
7714
7810
|
(!b.frameset || b.after_frameset)) {
|
|
7811
|
+
/* InBody reports the frame as a misplaced start tag
|
|
7812
|
+
* (tests25:10); the after-</frameset> phase names its
|
|
7813
|
+
* own code (the after-</html> phase is reported at the
|
|
7814
|
+
* start-tag dispatch). */
|
|
7815
|
+
if (!b.after_html) {
|
|
7816
|
+
if (!b.frameset)
|
|
7817
|
+
h_diag(&b, "unexpected-start-tag-ignored",
|
|
7818
|
+
(size_t)(p - b.input_base),
|
|
7819
|
+
"<frame> ignored in the body phase");
|
|
7820
|
+
else
|
|
7821
|
+
h_diag(&b, "unexpected-start-tag-after-frameset",
|
|
7822
|
+
(size_t)(p - b.input_base),
|
|
7823
|
+
"<frame> after </frameset>");
|
|
7824
|
+
}
|
|
7715
7825
|
while (q < end && *q != '>') q++;
|
|
7716
7826
|
p = (q < end) ? q + 1 : end;
|
|
7717
7827
|
text = p;
|
|
@@ -8531,6 +8641,13 @@ static LeptrisDocument html_parse_shared(
|
|
|
8531
8641
|
"input",
|
|
8532
8642
|
name);
|
|
8533
8643
|
}
|
|
8644
|
+
/* PLAINTEXT has no close form: it is still open at
|
|
8645
|
+
* EOF, so InBody processEOF reports the unclosed
|
|
8646
|
+
* element (tests18:2-7, tests19:6). */
|
|
8647
|
+
if (b.whatwg && cq >= end && strcmp(name, "plaintext") == 0)
|
|
8648
|
+
h_diag(&b, "expected-closing-tag-but-got-eof",
|
|
8649
|
+
(size_t)(end - b.input_base),
|
|
8650
|
+
"plaintext reaches end of input");
|
|
8534
8651
|
b.depth--; /* the raw element is complete */
|
|
8535
8652
|
text = p;
|
|
8536
8653
|
continue;
|
|
@@ -990,6 +990,14 @@ TEST(Html5LibCorpus, ErrorVerdictParity) {
|
|
|
990
990
|
* out-of-my-head tags; the select/table/foreign slice adds
|
|
991
991
|
* unexpected-input-in-select, hidden-input-in-table, and
|
|
992
992
|
* unexpected-html-element-in-foreign-content; the tokenizer
|
|
993
|
-
* slice adds need-space-after-doctype
|
|
994
|
-
|
|
993
|
+
* slice adds need-space-after-doctype; the misplaced-tag slice
|
|
994
|
+
* adds in-body caption/col/…/tr and frame (ignored), plus the
|
|
995
|
+
* stray </p> phase codes; the character-phase slice adds
|
|
996
|
+
* expected-eof-but-got-char and unexpected-char-after-body/
|
|
997
|
+
* -frameset; the tokenizer EOF slice adds eof-in-comment and
|
|
998
|
+
* eof-in-comment-double-dash; the plaintext/EOF slice adds the
|
|
999
|
+
* plaintext open-at-EOF and the "</" tokenizer EOF codes; the
|
|
1000
|
+
* stray-end-tag slice makes the depth-0 branch phase-aware for
|
|
1001
|
+
* raw-text, void and menuitem names. Only raises. */
|
|
1002
|
+
EXPECT_GE(parity, (size_t)1532);
|
|
995
1003
|
}
|
|
@@ -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.377",
|
|
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",
|