leptris 1.9.42 → 1.9.43
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/CHANGELOG.md +26 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/ffi.rb +4 -0
- data/lib/leptris/xml/pull.rb +13 -4
- 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: a87e2a5aa4eddbbaf1140aa87d33fcd3e0dccfb7ea505cbcaf917dbd3bf715fd
|
|
4
|
+
data.tar.gz: '09b6e2b0d46ed3235945f3ad3355fbf46d515ddfc0b3bce2ac75468a80d0af5d'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 267bbe8cac5597fa0e40736f087fffc739c9f3c1fb3063fbe652b25bb9e0a958424b283a5933a963c919d20db6128f35dcd2c98b94439613eeed3edcd17877f0
|
|
7
|
+
data.tar.gz: 93075be6a11e7fe9cdebfd812c617fe274ef9f93d67cce33d0c83b6e173b9f1fe6515aaff73907155fd09bae9d4867b8e6e35710551764b5554ea8c1214eefe7
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ All notable changes to Leptris will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.43] - 2026-08-31
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Pull prefix events surface (leptris-ruby#648's residual)**: the
|
|
13
|
+
engine's pull stream has always carried start/end prefix events
|
|
14
|
+
(codes 8/9; the default namespace's prefix is legitimately `""`)
|
|
15
|
+
— the binding's type map lacked the kinds, silently delivering
|
|
16
|
+
nil-typed Events that the 1.9.42 staging guard then misread as
|
|
17
|
+
corruption on healthy engines. `:start_prefix`/`:end_prefix` now
|
|
18
|
+
map correctly on both cursor and batch paths, and the guard's
|
|
19
|
+
name check only invalidates kinds that must carry names
|
|
20
|
+
(start/end element, PI target). Engine 1.9.21's staging fix
|
|
21
|
+
(upstream #648) verified clean through the batch path once the
|
|
22
|
+
kinds were mapped.
|
|
23
|
+
|
|
24
|
+
### Meta
|
|
25
|
+
|
|
26
|
+
- The 1.9.19–1.9.21 lockstep is HELD: engine 1.9.19+ carries a DOM
|
|
27
|
+
parse regression — a self-closing element followed by text inside
|
|
28
|
+
a depth-2 parent fails to parse (`<div><p><br/>hello</p></div>`)
|
|
29
|
+
— filed as leptris/leptris#653. `Node#visit` (the #645a
|
|
30
|
+
wrap-free walk), the sized ext-serialize entry (PR #107's
|
|
31
|
+
substance), and this pull fix's engine-1.9.21 verification are
|
|
32
|
+
parked on a branch awaiting the fix.
|
|
33
|
+
|
|
8
34
|
## [1.9.42] - 2026-08-30
|
|
9
35
|
|
|
10
36
|
### Fixed
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/ffi.rb
CHANGED
|
@@ -766,6 +766,10 @@ module Leptris
|
|
|
766
766
|
PULL_PI = 5
|
|
767
767
|
PULL_END_DOCUMENT = 6
|
|
768
768
|
PULL_ERROR = 7
|
|
769
|
+
# Prefix events (types.h LeptrisPullEventType 8/9): the
|
|
770
|
+
# default namespace's prefix is legitimately "".
|
|
771
|
+
PULL_START_PREFIX = 8
|
|
772
|
+
PULL_END_PREFIX = 9
|
|
769
773
|
|
|
770
774
|
LEPTRIS_PARSE_DEFAULT = 0
|
|
771
775
|
LEPTRIS_PARSE_DROP_WS_TEXT = 1
|
data/lib/leptris/xml/pull.rb
CHANGED
|
@@ -28,6 +28,13 @@ module Leptris::XML::Pull
|
|
|
28
28
|
Leptris::XML::FFI::PULL_PI => :pi,
|
|
29
29
|
Leptris::XML::FFI::PULL_END_DOCUMENT => :end_document,
|
|
30
30
|
Leptris::XML::FFI::PULL_ERROR => :error,
|
|
31
|
+
# Prefix events ride the stream ("" prefix = the default
|
|
32
|
+
# namespace): the engine has always delivered them; the map
|
|
33
|
+
# lacked the kinds, silently yielding nil-typed Events — which
|
|
34
|
+
# the staging guard then misread as corruption after the real
|
|
35
|
+
# engine fix landed (leptris/leptris#648's residual).
|
|
36
|
+
Leptris::XML::FFI::PULL_START_PREFIX => :start_prefix,
|
|
37
|
+
Leptris::XML::FFI::PULL_END_PREFIX => :end_prefix,
|
|
31
38
|
}.freeze
|
|
32
39
|
|
|
33
40
|
class Parser
|
|
@@ -87,7 +94,7 @@ module Leptris::XML::Pull
|
|
|
87
94
|
type = TYPES[buffer.get_int(base + type_off)]
|
|
88
95
|
name = name_ptr.null? ? nil :
|
|
89
96
|
name_ptr.read_string.force_encoding(Encoding::UTF_8)
|
|
90
|
-
# Staging-corruption guard (leptris/leptris#
|
|
97
|
+
# Staging-corruption guard (leptris/leptris#648): the C
|
|
91
98
|
# batch's staging arena misplaces record strings once the
|
|
92
99
|
# staged content crosses its block boundary (~185 bytes of
|
|
93
100
|
# attribute value under nested attr-carrying ancestors) —
|
|
@@ -97,10 +104,12 @@ module Leptris::XML::Pull
|
|
|
97
104
|
# instead of delivering garbage, and point at the cursor
|
|
98
105
|
# path, which reads the same documents correctly.
|
|
99
106
|
if type.nil? ||
|
|
100
|
-
(name && (
|
|
101
|
-
name.match?(/[\x00-\x08\x0e-\x1f]/)))
|
|
107
|
+
(name && (!name.valid_encoding? ||
|
|
108
|
+
name.match?(/[\x00-\x08\x0e-\x1f]/))) ||
|
|
109
|
+
(%i[start_element end_element pi].include?(type) &&
|
|
110
|
+
(name.nil? || name.empty?))
|
|
102
111
|
raise Leptris::XML::Error,
|
|
103
|
-
"pull batch staging corruption (leptris/leptris#
|
|
112
|
+
"pull batch staging corruption (leptris/leptris#648) — " \
|
|
104
113
|
"use Parser#each (cursor) for this document"
|
|
105
114
|
end
|
|
106
115
|
text = text_ptr.null? ? nil :
|