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 +4 -4
- data/lib/relaton/bib/sanitizer.rb +14 -0
- data/lib/relaton/bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6cd10d57ba0df13f6955cd1f4de3281605a5e6aca2e18f36a03d2b43a5198ea
|
|
4
|
+
data.tar.gz: d63fcf1de920b8563ad07061949f12695965c876f89539cd6cd05e735f16a3bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/relaton/bib/version.rb
CHANGED
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
|
+
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-
|
|
11
|
+
date: 2026-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bibtex-ruby
|