metanorma-standoc 2.10.2 → 2.10.4

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: d72c6ed69fa0ccc28a28c17306eee42d5a79512aac74e88fac810415ebed8744
4
- data.tar.gz: 7f965dc03a094785be980450a1c5370de9d43ddbae30c805ca65669911d0dc69
3
+ metadata.gz: 11972c007dd10b95b91d8598f5dce3843e59f7867e53768f43f03d04c63bf321
4
+ data.tar.gz: c22fd5262f6024f145c23d9f88471a9d8d061d51e7346fdac3535701715c36e5
5
5
  SHA512:
6
- metadata.gz: 49896c1fd5521c1065a6a789baf7008a312bc1706772aff2b9938621d97185d77f4f8cd24d13c7b50554549e33b1f04c7b3a12364548d2fd6994431b12c967b4
7
- data.tar.gz: 95e3c3de4fc714b04ebf54e24d2ae1c4d24cfafd9f9e3fb5795a5be8c5b86b302c6f2025d55eba42634666239faaa4cb863ad307eff14300765e8c096c00cc49
6
+ metadata.gz: 2f39425e1441e9b6d251669be2e3fd02967cd41a1f4f5bd65c71e9546a4e510bcf42ab89203eade13afa4e755847b4b3557c0be3c2a9839efd5a64ec013b5d36
7
+ data.tar.gz: bf360c1ce44587d5c7244e0edbb759109db93bd71c7c852c94bd3b020ca70fc4d981582891f98588492a923ee87e5224b2ed33617dd4cd37edf7480cc1e24955
@@ -34,14 +34,21 @@ module Metanorma
34
34
  end
35
35
  end
36
36
 
37
- def table_footnote_renumber1(fnote, idx, seen)
37
+ def duplicate_footnote(fnote, idx, seen)
38
38
  content = footnote_content(fnote)
39
- if seen[content] then outnum = seen[content]
39
+ if seen[content]
40
+ outnum = seen[content]
41
+ fnote.xpath(".//index | .//bookmark").each(&:remove)
40
42
  else
41
43
  idx += 1
42
44
  outnum = idx
43
45
  seen[content] = outnum
44
46
  end
47
+ [fnote, idx, seen, outnum]
48
+ end
49
+
50
+ def table_footnote_renumber1(fnote, idx, seen)
51
+ fnote, idx, seen, outnum = duplicate_footnote(fnote, idx, seen)
45
52
  fnote["reference"] = table_footnote_number(outnum)
46
53
  fnote["table"] = true
47
54
  [idx, seen]
@@ -62,15 +69,8 @@ module Metanorma
62
69
  end
63
70
 
64
71
  def other_footnote_renumber1(fnote, idx, seen)
65
- return [idx, seen] if fnote["table"]
66
-
67
- content = footnote_content(fnote)
68
- if seen[content] then outnum = seen[content]
69
- else
70
- idx += 1
71
- outnum = idx
72
- seen[content] = outnum
73
- end
72
+ fnote["table"] and return [idx, seen]
73
+ fnote, idx, seen, outnum = duplicate_footnote(fnote, idx, seen)
74
74
  fnote["reference"] = outnum.to_s
75
75
  [idx, seen]
76
76
  end
@@ -59,8 +59,10 @@ module Metanorma
59
59
  new[:extent] = [{ locality_stack: new[:extent] }]
60
60
  ret = merge_by_type(old.dig(:extent, 0),
61
61
  new.dig(:extent, 0), :locality_stack,
62
- %i[locality type])
63
- (ret && !old.dig(:extent, 0)) or return
62
+ [:locality, 0, :type]) or return
63
+ ret = ret.each_with_object([{ locality: [] }]) do |r, m|
64
+ m[0][:locality] += r[:locality]
65
+ end
64
66
  old[:extent] ||= []
65
67
  old[:extent][0] ||= {}
66
68
  old[:extent][0][:locality_stack] = ret
@@ -219,7 +219,7 @@ module Metanorma
219
219
 
220
220
  # manually check for xref/@target, xref/@to integrity
221
221
  def xref_validate(doc)
222
- @doc_xrefs = doc.xpath("//xref/@target | //xref/@to")
222
+ @doc_xrefs = doc.xpath("//xref/@target | //xref/@to | //index/@to")
223
223
  .each_with_object({}) do |x, m|
224
224
  m[x.text] = x
225
225
  @doc_ids[x.text] and next
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.10.2".freeze
22
+ VERSION = "2.10.4".freeze
23
23
  end
24
24
  end
@@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
43
43
  spec.add_dependency "asciimath2unitsml", "~> 0.4.0"
44
44
  spec.add_dependency "concurrent-ruby"
45
45
  spec.add_dependency "pngcheck"
46
- spec.add_dependency "relaton-cli", "~> 1.19.0"
46
+ spec.add_dependency "relaton-cli", "~> 1.20.0"
47
47
  spec.add_dependency "relaton-iev", "~> 1.2.0"
48
48
  spec.add_dependency "unicode2latex", "~> 0.0.1"
49
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.2
4
+ version: 2.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2024-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 1.19.0
215
+ version: 1.20.0
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 1.19.0
222
+ version: 1.20.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: relaton-iev
225
225
  requirement: !ruby/object:Gem::Requirement