leptris 1.9.376.0-aarch64-linux → 1.9.377.0-aarch64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a168f113b4166a6c421257fe05a739e4af03d7adcfe033865db4ba40c3c3b6be
4
- data.tar.gz: 73d10b549207b221954eb5fe16af7bf90f0f0be42f3b1d9d90b11a3813d3806d
3
+ metadata.gz: 219ca05fcab28bf94140e49c1d4424ad7453bcaf9aeb5e72e1e13354d4250cab
4
+ data.tar.gz: 68d614158658b99d9516dd15e2a079105c35c6133236333a0a04f6ada5fd0ca5
5
5
  SHA512:
6
- metadata.gz: a3ec1963f5eefe0d89d066c1e23bdc5356deea523e799cd7634722bfa557e7545855fbf521bbe038e7389985bf90278ed9e14b5f08aa6292f9f9f89dbf84dd96
7
- data.tar.gz: 2137c67f7e0820e7bf754150bf0f18fa054c7fe08531a7bf4a99ee1ad9af34001189a058ea2abe5f0c5d7b9d287900600f640507619dba585afea445b934b012
6
+ metadata.gz: 1bd0f3fa08a85ef4d92a5ec65cff603f586baef657a6f4290df7d7161189f423b54e1bd1b45dc9c0fd5250d3788f2c0149ee1ee876fe35475b5982d50b4dd830
7
+ data.tar.gz: 470154ffe7045fb6c5b0175953c057c8d33d373edfa4d6d57127f5625c60254b9671aae362bf45ceda8f2dac232d1b29531dfa04995718b3f758a363c07122c0
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.376"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.376.0"
4
+ VERSION = "1.9.377.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.376
4
+ - libleptris v1.9.377
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -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
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.376
6
+ VERSION 1.9.377
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -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) b->after_body_done = 1;
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 raw-text end tag with no open stack: the raw-text
6263
- * element completed during its start-tag handling, so this
6264
- * token cannot close anything. html5lib's InHead/InBody
6265
- * endTagOther reports unexpected-end-tag once the tree has
6266
- * content (the synthesized body is the special node);
6267
- * with nothing seen yet the phase errors differently and
6268
- * the initial-mode checks above already cover it. */
6269
- if (b.whatwg && nlen && b.depth == 0 && b.top_tail) {
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
- if (h_is_rawtext_name(rn)) {
6275
- h_diag(&b, "unexpected-end-tag",
6276
- (size_t)(p - b.input_base),
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. Only raises. */
994
- EXPECT_GE(parity, (size_t)1508);
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.376",
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",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.376.0
4
+ version: 1.9.377.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.