relaton-bib 2.1.4 → 2.1.5

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: c5fed587d3ea43b2fdba3f26039e44b076eea06413c7d44c815c44054bc2006a
4
- data.tar.gz: 1ce1ef4de4d2cc010e899971a247bba869ec67f588423dcd5e1e9d44beb36932
3
+ metadata.gz: c6cd10d57ba0df13f6955cd1f4de3281605a5e6aca2e18f36a03d2b43a5198ea
4
+ data.tar.gz: d63fcf1de920b8563ad07061949f12695965c876f89539cd6cd05e735f16a3bd
5
5
  SHA512:
6
- metadata.gz: 10279cf57d50ddb7e0339815be6edbc74ebc8568ffae16e2ca75f802939d3027639615fe117f060dc5985d0e3b074d021a4aa8a2a73745c6dd8aac7f71928f6c
7
- data.tar.gz: a53c8ca8225e43038fab4dc8c39dde6871e8fffdbe1bbc3816a47379dbf79f5033c4a8b5cb2eaefa5aba6529714f289507160c19e0fc70e54541ce18fbe53fae
6
+ metadata.gz: ead9da7e9c7b37c5b59c97d1e64358bad682ce125f47bf5fe149fbfc36a1cd3de0acd3e7fe56ea0ad7e1406a0aecc85b2992af31d33e3b0f473f92d27c1c81bd
7
+ data.tar.gz: a19370e34930cc03dd25750518c29707673fb710da209f7ecb96eba789a74e797935c4f7f3e7980d7e6ebec3aeded874a161787f02751d454146da1e590c12b1
@@ -12,12 +12,24 @@ module Relaton
12
12
  # consumers — notably relaton-render's own inline-tag allow-list —
13
13
  # already accept <fn> as a legitimate child of <title>. Stripping it
14
14
  # here would break the round-trip.
15
+ #
16
+ # OPAQUE elements (currently <stem>) are also allowed, but the
17
+ # sanitiser does not descend into them: their contents are out-of-band
18
+ # inline notation (MathML, AsciiMath, LaTeX) rather than basicdoc
19
+ # markup, and must be preserved verbatim. Without the opaque-skip,
20
+ # the recursive walk would unwrap MathML / AsciiMath elements down to
21
+ # bare text nodes — see #116 for the round-trip-loss symptom.
15
22
  module Sanitizer
16
23
  ALLOWED = %w[
17
24
  em strong sub sup tt underline strike smallcap br stem
18
25
  p eref xref fn
19
26
  ].freeze
20
27
 
28
+ # Elements whose children are non-basicdoc inline notation
29
+ # (MathML, AsciiMath, LaTeX, …) and must be preserved verbatim
30
+ # rather than sanitised against ALLOWED.
31
+ OPAQUE = %w[stem].freeze
32
+
21
33
  RENAME = {
22
34
  "italic" => "em",
23
35
  }.freeze
@@ -44,6 +56,8 @@ module Relaton
44
56
  next unless child.element?
45
57
 
46
58
  child.name = RENAME[child.name] if RENAME.key?(child.name)
59
+ next if OPAQUE.include?(child.name)
60
+
47
61
  sanitize_children(child)
48
62
  child.replace(child.children) unless ALLOWED.include?(child.name)
49
63
  end
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Bib
3
- VERSION = "2.1.4".freeze
3
+ VERSION = "2.1.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-02 00:00:00.000000000 Z
11
+ date: 2026-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bibtex-ruby