isodoc 2.7.2 → 2.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8e11539f17ee97d00f3b2f4470b384f1caf06cb5d72b11fc408b731f071e55b
4
- data.tar.gz: 9f45bc01cc6aa695152e0f237f281bad777eb745836c4f08880467781c722942
3
+ metadata.gz: eb9c5b4a4ae20094a096ef37012c56b2f125a636c0aa426d135f1b8257cbf205
4
+ data.tar.gz: a1f5bbeed6904bd7d958ee0fdaeb4b180f0bf5405a42d556f7e787153247130d
5
5
  SHA512:
6
- metadata.gz: 0174b0cb445a70b50ccaeda366c6d843a924fa481a047eb04c6c65c127b42cf789e274270fb4a6573f10040d0830ea7370081bcf0df366055baddaf7c3d991d0
7
- data.tar.gz: cc9cd1214a0ce46d3cc8bd34646f9c2d629c9e1ce6116e2a03fd19dbca5e1f0c07ba1e20b67a1e5b713e6bbaaf4fbe00ccaa69ed580000b161f5cacaf4158d86
6
+ metadata.gz: a9aa50e9e6b759064321dbb68b46bbe9ab6d321ac73d584aad19b8ecedb109ee48119d06e72c03f7802910946d73ae72e08b24b502d3495d04e7805141de522a
7
+ data.tar.gz: fb4483cd05281ce5278d745c2ecc7f8b73139e1e47a643700c9112747ce475869c570a1555d836277cb6ed90c7d544b43eda21bc6b81a5f08b7470fb14ad8f73
@@ -16,15 +16,21 @@ module IsoDoc
16
16
  end
17
17
 
18
18
  def extension_insert(xml, path = [])
19
- ins = xml.at(ns("//metanorma-extension")) ||
20
- xml.at(ns("//bibdata"))&.after("<metanorma-extension/>")&.next_element ||
21
- xml.root.elements.first.before("<metanorma-extension/>").previous_element
19
+ ins = extension_insert_pt(xml)
22
20
  path.each do |n|
23
21
  ins = ins.at(ns("./#{n}")) || ins.add_child("<#{n}/>").first
24
22
  end
25
23
  ins
26
24
  end
27
25
 
26
+ def extension_insert_pt(xml)
27
+ xml.at(ns("//metanorma-extension")) ||
28
+ xml.at(ns("//bibdata"))&.after("<metanorma-extension/>")
29
+ &.next_element ||
30
+ xml.root.elements.first.before("<metanorma-extension/>")
31
+ .previous_element
32
+ end
33
+
28
34
  def preprocess_xslt_insert(docxml)
29
35
  content = ""
30
36
  p = passthrough_xslt and content += p
@@ -42,7 +48,6 @@ module IsoDoc
42
48
  <preprocess-xslt format="#{k}">
43
49
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
44
50
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
45
- <xsl:strip-space elements="*"/>
46
51
  <xsl:template match="@* | node()">
47
52
  <xsl:copy>
48
53
  <xsl:apply-templates select="@* | node()"/>
@@ -142,7 +147,8 @@ module IsoDoc
142
147
  tag_translate(x, lang, hash[x.text])
143
148
  end
144
149
 
145
- # does not allow %Spellout and %Ordinal in the ordinal expression to be mixed
150
+ # does not allow %Spellout and %Ordinal in the ordinal expression
151
+ # to be mixed
146
152
  def edition_translate(bibdata)
147
153
  x = bibdata.at(ns("./edition")) or return
148
154
  /^\d+$/.match?(x.text) or return
@@ -221,11 +227,9 @@ module IsoDoc
221
227
  end
222
228
 
223
229
  def trim_hash1(hash)
224
- return hash unless hash.is_a? Hash
225
-
230
+ hash.is_a?(Hash) or return hash
226
231
  hash.each_with_object({}) do |(k, v), g|
227
- next if blank?(v)
228
-
232
+ blank?(v) and next
229
233
  g[k] = case v
230
234
  when Hash then trim_hash1(hash[k])
231
235
  when Array
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "2.7.2".freeze
2
+ VERSION = "2.7.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-10 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html2doc