metanorma-standoc 3.2.1 → 3.2.2
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/metanorma/standoc/cleanup_bibdata.rb +14 -4
- data/lib/metanorma/standoc/version.rb +1 -1
- 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: c27d73b91928d6d63beea3098dfaab2ad832d42665d465178fb9c393e40133df
|
|
4
|
+
data.tar.gz: 0563c950d0488cf825e4325b1d4df2ef6b67819be9d73db1f2416d56fc8f8cc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04c0dfc2354b96183090c85682ecb7c026e2e2332a495916036378f45fefa795fc8fd05f46e07d2c043eaf88c86330569ee734ef3e8ea182045193269e33df6b
|
|
7
|
+
data.tar.gz: '0394a7c42e79dfea94fbcb89148c9964894b7d73538d92ac065992362338cfb36ac7bc720948cad1f11a0d0a477e9a73aefcf81c9a513eb8b083340d4d7c751c'
|
|
@@ -8,6 +8,7 @@ module Metanorma
|
|
|
8
8
|
bibdata_embed_id_cleanup(xmldoc)
|
|
9
9
|
biblio_indirect_erefs(xmldoc, @internal_eref_namespaces&.uniq)
|
|
10
10
|
coverpage_images(xmldoc)
|
|
11
|
+
bibdata_empty_contribs(xmldoc)
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def coverpage_images(xmldoc)
|
|
@@ -119,9 +120,9 @@ module Metanorma
|
|
|
119
120
|
end
|
|
120
121
|
|
|
121
122
|
def hdr2bibitem(hdr)
|
|
122
|
-
xml = isolated_asciidoctor_convert(hdr[:text],
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
xml = isolated_asciidoctor_convert(hdr[:text],
|
|
124
|
+
backend: hdr2bibitem_type(hdr),
|
|
125
|
+
header_footer: true)
|
|
125
126
|
b = Nokogiri::XML(xml).at("//xmlns:bibdata")
|
|
126
127
|
b.name = "bibitem"
|
|
127
128
|
b.delete("type")
|
|
@@ -152,7 +153,9 @@ module Metanorma
|
|
|
152
153
|
ident = bibdata.at("./docidentifier[@primary = 'true']") ||
|
|
153
154
|
bibdata.at("./docidentifier")
|
|
154
155
|
xmldoc.xpath("//xref[@target = '#{d}'][normalize-space(.//text()) = '']")
|
|
155
|
-
.each
|
|
156
|
+
.each do |x|
|
|
157
|
+
x << ident.text
|
|
158
|
+
end
|
|
156
159
|
end
|
|
157
160
|
end
|
|
158
161
|
|
|
@@ -205,6 +208,13 @@ module Metanorma
|
|
|
205
208
|
x.replace(x.children)
|
|
206
209
|
end
|
|
207
210
|
end
|
|
211
|
+
|
|
212
|
+
def bibdata_empty_contribs(xmldoc)
|
|
213
|
+
xmldoc.xpath("//bibdata//contributor").each do |c|
|
|
214
|
+
p = c.at("./person | ./organization")
|
|
215
|
+
p.nil? || p.text.strip.empty? and c.remove
|
|
216
|
+
end
|
|
217
|
+
end
|
|
208
218
|
end
|
|
209
219
|
end
|
|
210
220
|
end
|