metanorma-iso 3.1.7 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b88715ca34a125fc47d4e293e7134cf602ae3a48953f12bd6c13641129791844
4
- data.tar.gz: 37201b90fee7182fd99448a0d3803ad2ce9d0aa16f001eab3bec5b629f3ecacf
3
+ metadata.gz: '06585186ffa8c41465b19f7e7b98c16af489febfa31216e5358d10f8103fe3b6'
4
+ data.tar.gz: '097fa39c8d80b04eadad3d7e301a445bdceaceccfd89bedff64830f39bb80b82'
5
5
  SHA512:
6
- metadata.gz: 8f964265cdce903a92cc728bf280f41c971ffa72696768e7d5694c56d34114d9f466100ed6a856a2466fbcc14582b33d28a9e764b00708a60cfb56f4c237eafa
7
- data.tar.gz: f9cff23e2ea300a7651a87a5ab93a6c7a3b59773b5ff64be725a66ba19524544bc3b312d9e83c618b8c253d2df7bb8ae6cd508705f0d59c8e3a6a5da1d78b3d6
6
+ metadata.gz: 0b84e6420b6f72a068dbf66a3a52e7e6264206ea39d1eb260d1c5087bf4eeb0e28e1add9b0c66df348dbed3ba4e814f0ce78f1ed65d5718430324ba594068d4f
7
+ data.tar.gz: 4f2b014aad730605cd669832e2b0243f06223cc21bd226f261fb2597d61eb103bf91695ad20ec76c5571e53649290d13fc3e802be97b4fb88c890d5ff6684a20
@@ -37,7 +37,8 @@ module IsoDoc
37
37
  requirement docxml
38
38
  recommendation docxml
39
39
  requirement_render docxml
40
- @xrefs.anchors_previous = @xrefs.anchors.dup # store old xrefs of reqts
40
+ @xrefs.anchors_previous =
41
+ @xrefs.anchors.transform_values(&:dup) # store old xrefs of reqts
41
42
  @xrefs.parse docxml
42
43
  # TODO move this dependency around: requirements at root should be processed before everything else
43
44
  table docxml # have table include requirements newly converted to tables
@@ -250,7 +250,21 @@ container: false)
250
250
  has_table_prefix = @anchors.dig(e, :has_table_prefix)
251
251
  has_table_prefix and return
252
252
  super
253
- #has_table_prefix and @anchors[e][:has_table_prefix] = true # restore
253
+ # has_table_prefix and @anchors[e][:has_table_prefix] = true # restore
254
+ end
255
+
256
+ def localise_anchors(type = nil)
257
+ @anchors.each do |id, v|
258
+ type && v[:type] != type and next
259
+ #v[:has_table_prefix] and next
260
+ # has already been l10n'd, is copied from prev iteration
261
+ %i(label value xref xref_bare modspec).each do |t|
262
+ v[t] && !v[t].empty? or next
263
+ # Skip if value unchanged from previous iteration
264
+ @anchors_previous&.dig(id, t) == v[t] and next
265
+ v[t] = @i18n.l10n(v[t])
266
+ end
267
+ end
254
268
  end
255
269
  end
256
270
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iso
3
- VERSION = "3.1.7".freeze
3
+ VERSION = "3.1.8".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.