isodoc 3.7.22 → 3.7.24

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: dbf70f2270108a9954659cb9a101a731e81c333e9d7b8b2206888bb3a6d7cd99
4
- data.tar.gz: c33ceb407707efcc89acbb01d913bc68d0aed61c5722d2afe7e76927b67226a8
3
+ metadata.gz: 81c68ce0cd1295ac6eaa183f906428da439fe7364a2f528e21ed918fe71afebb
4
+ data.tar.gz: c0ae9c5ecbfbdd1b17f38a8679d6a29f9ec13452e5126ba93f4dcdc119e4a642
5
5
  SHA512:
6
- metadata.gz: 647e985063f6a163df57c24e278eab3b5b57c4755bd3f9423b0aecf1a42d510bb3d808ee35a5427cdcfadc5263b20ba8740989a539448591e9a828ba8f501b6d
7
- data.tar.gz: 82e7df3303fad27057a4104b271fea4ee42696e86811e972bacf03d2670beea904abfa253637dd893217a868b3d8322083e56240a34501b5f03fe1849bff6a9d
6
+ metadata.gz: 7478a0f8926066606a14e60798a41f546692eb40f77ddf4d2f3c4e935f313aa1a4147ede3c0795b9861e72e14b0a15260c35e7f53d0a812fce24bd70a1a9e5a4
7
+ data.tar.gz: 7fe7ab2e65f121eca83ebe80158b9e5cad9847cc214045402363d21235e64bf5e262652e46a46725abc14f69e5dd52a45444e92d143d68e78ac8f229ec9277ee
data/isodoc.gemspec CHANGED
@@ -39,7 +39,11 @@ Gem::Specification.new do |spec|
39
39
  # std_docid_semantic parses through the pubid monogem's flavor
40
40
  # registry (Pubid.eager_load_flavors!) — 2.x API, no per-flavor gems
41
41
  spec.add_dependency "pubid", "~> 2.0.3"
42
- # spec.add_dependency "metanorma-utils", "~> 2.0" # already in isodoc-i18n
42
+ # contenthash (Metanorma::Utils.contenthash) is called directly in
43
+ # table-footnote and term-anchor paths; it exists from metanorma-utils
44
+ # 2.0.0. Declared directly — do not rely on the isodoc-i18n transitive
45
+ # floor (which could resolve a 1.x utils without the method).
46
+ spec.add_dependency "metanorma-utils", "~> 2.0"
43
47
  spec.add_dependency "mn2pdf", ">= 2.13"
44
48
  spec.add_dependency "mn-requirements", "~> 0.5.0"
45
49
  spec.add_dependency "roman-numerals"
@@ -137,10 +137,22 @@ module IsoDoc
137
137
  dest = docxml.at("//div[@id = 'toc']") or return
138
138
  if source = docxml.at("//div[@class = 'TOC']")
139
139
  dest << to_xml(source.remove.children)
140
+ toc_retarget_source_anchors(dest, source["id"])
140
141
  end
141
142
  dest
142
143
  end
143
144
 
145
+ # The ToC clause headings moved into the destination carry anchor
146
+ # permalinks minted by heading_anchors, pointing at the id of the
147
+ # ToC clause div that has just been removed. Retarget them at the
148
+ # destination the headings now live in, so they do not dangle.
149
+ def toc_retarget_source_anchors(dest, source_id)
150
+ dest.xpath(".//a[@class = 'anchor' or @class = 'header']" \
151
+ "[@href = '##{source_id}']").each do |a|
152
+ a["href"] = "##{dest['id']}"
153
+ end
154
+ end
155
+
144
156
  def html_toc_entries(docxml, path)
145
157
  headers = html_toc_entries_prep(docxml, path)
146
158
  path.each_with_index.with_object([]) do |(p, i), m|
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "3.7.22".freeze
2
+ VERSION = "3.7.24".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.22
4
+ version: 3.7.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 2.0.3
111
+ - !ruby/object:Gem::Dependency
112
+ name: metanorma-utils
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: mn2pdf
113
127
  requirement: !ruby/object:Gem::Requirement