leptris 1.9.186.0 → 1.9.188.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c702e5d445cbabe1892ea5aa261caf972a9ada194bb5abdb0a90afe5f249fa5
4
- data.tar.gz: c9f55612f94575433e996905aeb06c5716b6fe2c7bb2fb1acde277f7f53e7746
3
+ metadata.gz: cf80ccf870ddf66abc6a3a4fa99727a9f15d8da89649f337c34d7d24349eb94f
4
+ data.tar.gz: 95bc3a48e901eda33ba20492d98007da08746dbbef90a391fe518ec37db2942b
5
5
  SHA512:
6
- metadata.gz: 44009c3f0160ec11265c21fa17e3d54dfd89f4629ef8d8bae8934c5063e08e1579a4e20f1de42dc18dc0f94ca427c30e2c6785251ccfc9f5ff88e65ef088bc4e
7
- data.tar.gz: cfe692871915a7dd8788ec8e2762c71b025e8e88df5eadf2bbe6c5b9203b875e91e28fd0ca53acf08cf61da6c3a8de8211c185e3a6d82a297effb77079096143
6
+ metadata.gz: fa413d38c0dc9571c72564d8df2277ddc4c47b0b9a3e38c00824c54b50042042f2594c2acddc94800ba7cd5b455b9b72296b69abe61c0e99711f860de4bd1a71
7
+ data.tar.gz: '089846a5778f5e3fe3bdf8daa0460f09e81cd4d31250860cf12129de8918caefddc219eb11e445898ca183c94490fed804ed3a89b0bea4fb5c94af6a55eaf8e4'
data/CHANGELOG.md CHANGED
@@ -5,6 +5,45 @@ 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.188.0] - 2026-09-17
9
+
10
+ ### Changed — libleptris 1.9.186 → 1.9.188 (lockstep)
11
+
12
+ - **RELAX NG: foreign-namespace annotation elements are skipped**
13
+ in patterns (1.9.187) — `a:documentation` and friends no longer
14
+ abort schema compilation (the metanorma isodoc-compile.rng
15
+ family). Spec-pinned.
16
+ - **RELAX NG: `externalRef`** (1.9.188) — the referenced grammar's
17
+ `<start>` splices in as the pattern body, defines merge so refs
18
+ inside the external grammar resolve; depth-guarded, href-relative
19
+ via `parse_file`. Spec-pinned.
20
+ - **RELAX NG: `anyName` name class** (RELAX NG 4.14, 1.9.188) for
21
+ elements and attributes — the biblio.rng recursive AnyElement
22
+ shape. Spec-pinned. Known engine laxness (bare text under the
23
+ wildcard validates; Jing rejects) filed upstream as
24
+ leptris/leptris#1153 — deliberately not pinned here.
25
+ - **`leptris_rng_parse_file` publishes schema-parse detail** to
26
+ `leptris_last_error` (1.9.188) — `Schema.parse_file` failures
27
+ now raise with the engine's reason instead of an empty channel.
28
+ Spec-pinned.
29
+ - **HTML: after-body insertion-mode restore** (1.9.187, #659) —
30
+ non-whitespace text after `</body>` switches back to in-body;
31
+ text and later comments flow into the still-open body.
32
+ Spec-pinned.
33
+ - No public-symbol changes: audit 322/322.
34
+
35
+ ## [1.9.186.1] - 2026-09-17
36
+
37
+ ### Added
38
+
39
+ - `RelaxNG::Schema#validate_errors(document)` — structured
40
+ `[{ line:, column:, message: }]` rows (Jing's exact attribution,
41
+ upstream #878 accumulation), for callers that need the fields
42
+ for log formatting instead of re-parsing the Jing-form strings
43
+ from `#validate`. `#validate` now renders its strings from the
44
+ same rows (one enumeration of the error surface; identical
45
+ output, including the back-compat zero-count fallback).
46
+
8
47
  ## [1.9.186.0] - 2026-09-17
9
48
 
10
49
  ### Changed — libleptris 1.9.181 → 1.9.186 (lockstep)
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.186"
11
+ LIBLEPTRIS_VERSION = "1.9.188"
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.186.0"
4
+ VERSION = "1.9.188.0"
5
5
  end
@@ -22,6 +22,7 @@ module Leptris::XML::RelaxNG
22
22
  # rng = Leptris::XML::RelaxNG.parse(schema_xml)
23
23
  # rng.valid?(doc) # => true/false
24
24
  # rng.validate(doc) # => [] or ["1:0: error: element ..."]
25
+ # rng.validate_errors(doc) # => [] or [{line:, column:, message:}]
25
26
  #
26
27
  class Schema
27
28
  # GC-managed compiled handle.
@@ -63,25 +64,45 @@ module Leptris::XML::RelaxNG
63
64
  # libleptris 1.9.179 (#878): errors accumulate — every failure
64
65
  # from the validate call is returned, not just the first.
65
66
  def validate(document)
67
+ structured = validate_errors(document)
68
+ unless structured.empty?
69
+ return structured.map do |e|
70
+ e[:line] > 0 ? "#{e[:line]}:#{e[:column]}: error: #{e[:message]}"
71
+ : e[:message]
72
+ end
73
+ end
74
+ # Invalid verdict with nothing accumulated: the back-compat
75
+ # single-error accessor is the last resort (nil-safe).
76
+ return [] if valid?(document)
77
+ [Leptris::XML::FFI.leptris_rng_error(@handle)].compact
78
+ end
79
+
80
+ def valid?(document)
81
+ Leptris::XML::FFI.leptris_rng_validate(@handle,
82
+ document.c_ptr) != 0
83
+ end
84
+
85
+ # Structured errors: [{ line:, column:, message: }] — the fields
86
+ # callers need for log formatting, instead of re-parsing the
87
+ # Jing-form strings from #validate. Empty when valid. Message,
88
+ # line, and column carry Jing's exact attribution (libleptris
89
+ # >= 1.9.179, upstream #878). This is the single enumeration of
90
+ # the error-accumulation surface; #validate renders these rows.
91
+ def validate_errors(document)
66
92
  ok = Leptris::XML::FFI.leptris_rng_validate(@handle,
67
93
  document.c_ptr)
68
94
  return [] if ok != 0
69
95
  count = Leptris::XML::FFI.leptris_rng_error_count(@handle)
70
- return [Leptris::XML::FFI.leptris_rng_error(@handle)].compact if count.zero?
71
- # Jing's rendering for every accumulated error, matching the
72
- # single-error accessor's format ("line:col: error: msg").
96
+ return [] if count.zero?
73
97
  Array.new(count) do |i|
74
98
  msg = Leptris::XML::FFI.leptris_rng_error_message(@handle, i)
75
99
  next nil if msg.nil?
76
- line = Leptris::XML::FFI.leptris_rng_error_line(@handle, i)
77
- col = Leptris::XML::FFI.leptris_rng_error_column(@handle, i)
78
- line > 0 ? "#{line}:#{col}: error: #{msg}" : msg
100
+ {
101
+ line: Leptris::XML::FFI.leptris_rng_error_line(@handle, i),
102
+ column: Leptris::XML::FFI.leptris_rng_error_column(@handle, i),
103
+ message: msg,
104
+ }
79
105
  end.compact
80
106
  end
81
-
82
- def valid?(document)
83
- Leptris::XML::FFI.leptris_rng_validate(@handle,
84
- document.c_ptr) != 0
85
- end
86
107
  end
87
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.186.0
4
+ version: 1.9.188.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-16 00:00:00.000000000 Z
11
+ date: 2026-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi