relaton-cli 1.20.7 → 1.20.8
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/bibcollection.rb +10 -2
- data/lib/relaton/cli/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: 55ccde87852cdba9989932b8e25ae82aef8a474d841badb1116d22d24923a029
|
|
4
|
+
data.tar.gz: 9f271487d15f55e0fbdc83bb73a3bb0547ff19c2cd192416cbe652d73e282559
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d01e607b7fa05154f558ff78122a71834f18da5493eb5a632eefff5faeab78015d64a2c7ed214d50800f6cdb47bc2133573674d1c23976acdb98ec586b71505
|
|
7
|
+
data.tar.gz: a3f5d64b7a11687520f3e27d62d9b094aa4f5dbe017bc081e237636c50f83c434712ffafb865d1ac799dbbbdae7c034ad0a6c5c8bd76f13624e5317d08c5b8d2
|
|
@@ -61,10 +61,10 @@ module Relaton
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
ret = "<relaton-collection #{collection_type}>"
|
|
64
|
-
ret += "<title>#{title}</title>" if title
|
|
64
|
+
ret += "<title>#{xml_escape(title)}</title>" if title
|
|
65
65
|
if author
|
|
66
66
|
ret += "<contributor><role type='author'/><organization><name>"\
|
|
67
|
-
"#{author}</name></organization></contributor>"
|
|
67
|
+
"#{xml_escape(author)}</name></organization></contributor>"
|
|
68
68
|
end
|
|
69
69
|
unless items.empty?
|
|
70
70
|
items.each do |item|
|
|
@@ -134,5 +134,13 @@ module Relaton
|
|
|
134
134
|
end
|
|
135
135
|
end
|
|
136
136
|
end
|
|
137
|
+
|
|
138
|
+
# Escape bare & in content for XML serialization, leaving already-encoded
|
|
139
|
+
# entity references (&, {, ) and inline markup (<em> etc.)
|
|
140
|
+
# untouched. This prevents invalid XML when plain-text values (e.g. from
|
|
141
|
+
# YAML) contain literal ampersands.
|
|
142
|
+
def xml_escape(str)
|
|
143
|
+
str.gsub(/&(?![a-zA-Z][a-zA-Z0-9]*;|#[0-9]+;|#x[0-9a-fA-F]+;)/, "&")
|
|
144
|
+
end
|
|
137
145
|
end
|
|
138
146
|
end
|
data/lib/relaton/cli/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.20.
|
|
4
|
+
version: 1.20.8
|
|
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-05-
|
|
11
|
+
date: 2026-05-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: liquid
|