metanorma-standoc 2.10.1 → 2.10.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: eba98884570df0264d11870712b7da4d6369a168c43580657897957ed4b3d5ab
4
- data.tar.gz: 79535910f373fb36adc22fa6113bcb397cddf7f167c00c9356cc1549998af846
3
+ metadata.gz: 8c8579fdf53dcc2a4f8bb20de409cb062e6b9391bdad00e87ccdde6a571c025a
4
+ data.tar.gz: 89991dbd9dc49750e3ba9ca705872768510d0789907191e989e0473a9d0fc2d4
5
5
  SHA512:
6
- metadata.gz: 874d889b1e6ad14091a6f8dc6aff928070957e95da4ef8d4af1bf55a479c645f1db6965a35e580924d06ea09c467ad201b035003237c6d53718fa9c3d13b6118
7
- data.tar.gz: 5d300aa539043afb930059fdc644318a439883645cb1afe9c1bb977beca71a22ed1c043aa615f5d021b80c1d3eaec0275d085ede665235f375e3f980d41b08f2
6
+ metadata.gz: '0648f42502642e1e2cf3e5db6a9f8d51056c088879f363a2f2cdda4daa9e32ff2a94ddfbc1c0735965cf889c431c6cfc8b8b7d45eb590f9d41b6aa4be3e81b1e'
7
+ data.tar.gz: f6c43c0445dd5f51942808693dd9b9be01a425ec22ec711a82377630db69aee0cceb03fa5091d1716d78ac911130fc585b82d7f522f0d0bc183bfe41e7c55da7
@@ -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
@@ -88,6 +88,15 @@ module Metanorma
88
88
  end
89
89
  end
90
90
 
91
+ # "abc<tag/>", def => "abc",<tag/> def
92
+ # TODO?
93
+ def uninterrupt_quotes_around_xml1(xmldoc)
94
+ xmldoc.xpath("//text()[preceding-sibling::*[1]]").each do |n|
95
+ uninterrupt_quotes_around_xml_skip(n) and next
96
+ uninterrupt_quotes_around_xml1(n.previous)
97
+ end
98
+ end
99
+
91
100
  IGNORE_QUOTES_ELEMENTS =
92
101
  %w(pre tt sourcecode stem asciimath figure bibdata passthrough
93
102
  identifier metanorma-extension).freeze
@@ -157,6 +166,20 @@ module Metanorma
157
166
  end
158
167
  end
159
168
 
169
+ def dumb2smart_quotesx(xmldoc)
170
+ # TODO?>
171
+ prev = ""
172
+ xmldoc.xpath("//* | //text()").each do |x|
173
+ x.is_a?(Nokogiri::XML::Node) or next
174
+ block?(x) and prev = ""
175
+ empty_tag_with_text_content?(x) and prev = "dummy"
176
+ x.text? or next
177
+ ancestor_include?(x, IGNORE_QUOTES_ELEMENTS) and next
178
+ dumb2smart_quotes1(x, prev)
179
+ prev = x.text
180
+ end
181
+ end
182
+
160
183
  def dumb2smart_quotes1(curr, prev)
161
184
  /[-'"(<>]|\.\.|\dx/.match?(curr.text) or return
162
185
 
@@ -59,8 +59,11 @@ 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])
63
+ ret = ret.each_with_object([{ locality: [] }]) do |r, m|
64
+ m[0][:locality] += r[:locality]
65
+ end
66
+ ret or return
64
67
  old[:extent] ||= []
65
68
  old[:extent][0] ||= {}
66
69
  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.1".freeze
22
+ VERSION = "2.10.3".freeze
23
23
  end
24
24
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "asciidoctor", "~> 2.0.0"
33
33
  spec.add_dependency "crass", "~> 1.0.0"
34
34
  spec.add_dependency "iev", "~> 0.3.0"
35
- spec.add_dependency "isodoc", "~> 2.12.2"
35
+ spec.add_dependency "isodoc", "~> 2.12.4"
36
36
  spec.add_dependency "metanorma", ">= 1.6.0"
37
37
  spec.add_dependency "metanorma-plugin-datastruct", "~> 0.3.0"
38
38
  spec.add_dependency "metanorma-plugin-glossarist", "~> 0.2.0"
@@ -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.1
4
+ version: 2.10.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: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2024-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.12.2
75
+ version: 2.12.4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.12.2
82
+ version: 2.12.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: metanorma
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -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