metanorma 2.5.17 → 2.5.18

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: e74645aab84c8445fdcbdab1190af0c3e885aa315b987d9f608c6633d2453fd0
4
- data.tar.gz: e71224bccf1879c5356ad8420b638d31de3bfa4f602fbed210328990965c1e2b
3
+ metadata.gz: ed6ff0475b37b107b11392c1f9138994c87ce6d6c7aeb96fdbdea87163c845a6
4
+ data.tar.gz: 02daf01867340c397af44cc50579f6aa25368052b68398994fa405d76619aad0
5
5
  SHA512:
6
- metadata.gz: e499614dc2d81c316a92908f5bd22e1fff19b92095ccbabff70a1411bd011e4e7fbef871a490c9ed3d17d76d3ed20ceebcf6c967b7503a6ca4a2756dfe974eeb
7
- data.tar.gz: 56c95bb8a97425b3b6f3106f91fd5c92fba09383d135251fc2c4998c35f4ba88244b849b9f11a23eb08d8280699cdcb58a12cc448db91d6658b95305c3408104
6
+ metadata.gz: 26a6ab25936320630c53f7df4b8dc9c39352f5dc77f5f72b9e0d12b01c459f5cbdcd06fea0298b2387f01700067bba3a2468cd1f2dad308bf53efffb0302a463
7
+ data.tar.gz: e90b384b30d236a229acf8748089cd242860ea07884d049689722581cecc012645092efa7df23184e07759eb6c7911685ee457de8d1743973a63bf053f5b0e08
data/Gemfile CHANGED
@@ -10,14 +10,14 @@ gem "relaton", "~> 3.0"
10
10
  gem "metanorma-core", ">= 0.2.5"
11
11
 
12
12
  # taste stack the compile specs exercise: the oiml taste registers the
13
- # flavor and lazily requires metanorma-oiml (OIML STS transformers,
14
- # unreleased); mko main carries the model-side export entry.
13
+ # flavor and lazily requires metanorma-oiml (OIML STS transformers);
14
+ # mko carries the model-side export entry.
15
15
  # Lives here, not in Gemfile.devel: consumer workflows may rewrite the
16
16
  # devel overlay (fontist CI appends its path pin to it), and the repo's
17
17
  # own compile specs must not depend on its survival.
18
18
  gem "metanorma-taste", "~> 1.1"
19
- gem "metanorma-oiml", github: "metanorma/metanorma-oiml", branch: "main"
20
- gem "metanorma-mko", github: "metanorma/metanorma-mko", branch: "main"
19
+ gem "metanorma-oiml", "~> 0.1"
20
+ gem "metanorma-mko", "~> 1.1"
21
21
 
22
22
  begin
23
23
  eval_gemfile("Gemfile.devel")
data/Gemfile.devel CHANGED
@@ -1,13 +1,10 @@
1
1
  # Local development pins (eval'd by Gemfile; not committed workflow state)
2
- gem "metanorma-document", github: "metanorma/metanorma-document", branch: "main"
3
- gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "main"
4
- gem "metanorma-iso", github: "metanorma/metanorma-iso", branch: "main"
5
- gem "isodoc", github: "metanorma/isodoc", branch: "main"
6
- # released metanorma-iho 1.4.0 still carries lib/relaton/render/general.rb,
7
- # which shadows relaton-render's iso690 autoload by load-path name; iho
8
- # main relocated its render files
9
- gem "metanorma-iho", github: "metanorma/metanorma-iho", branch: "main"
10
- gem "pubid", "~> 2.0.0.pre.alpha"
2
+ gem "metanorma-document", "~> 0.5"
3
+ gem "metanorma-standoc", "~> 3.5"
4
+ gem "metanorma-iso", "~> 3.5"
5
+ gem "isodoc", "~> 3.7"
6
+ gem "metanorma-iho", "~> 1.4"
7
+ gem "pubid", "~> 2.0"
11
8
  # The 1.9.356/0.5.13x pin pair worked around the leptris#1733 to_xml
12
9
  # regression; retired — moxml rides the 0.6 line (0.5 series gets no
13
10
  # fixes; 0.6.0 removed the Opal surface, lutaml/moxml#516), which
@@ -49,7 +49,7 @@ module Metanorma
49
49
  ids, docxml, isodoc, tag = svgmap_resolve_prep(docxml, docid, presxml)
50
50
 
51
51
  # Stage 1: Resolve EREF references to their targets
52
- resolve_svgmap_erefs(docxml, tag, isodoc, ids, presxml)
52
+ resolve_svgmap_erefs(docxml, tag, isodoc, ids, presxml, docid)
53
53
 
54
54
  # Stage 1b: Re-key the svgmap xref targets that a reinflated render
55
55
  # carries from the staging build: they name anchors in the compile-
@@ -100,9 +100,9 @@ module Metanorma
100
100
  private
101
101
 
102
102
  # Resolves EREF elements within svgmap to their actual link targets
103
- def resolve_svgmap_erefs(docxml, tag, isodoc, ids, presxml)
103
+ def resolve_svgmap_erefs(docxml, tag, isodoc, ids, presxml, docid)
104
104
  docxml.xpath(ns("//svgmap//#{tag}")).each do |e|
105
- svgmap_resolve_eref(e, isodoc, docxml, ids, presxml)
105
+ svgmap_resolve_eref(e, isodoc, docxml, ids, presxml, docid)
106
106
  end
107
107
  end
108
108
 
@@ -160,16 +160,35 @@ module Metanorma
160
160
  end
161
161
 
162
162
  # Resolves a single EREF element to its target link
163
- def svgmap_resolve_eref(eref, isodoc, _docxml, ids, presxml)
163
+ def svgmap_resolve_eref(eref, isodoc, _docxml, ids, presxml, docid)
164
164
  href = isodoc.eref_target(eref) or return
165
165
  href = href[:link]
166
166
  href == "##{eref['bibitemid']}" ||
167
167
  (href =~ /^#/ && !ids[href.sub(/^#/, "")]) and return
168
+ href = remap_cross_member_hotspot(href, docid)
168
169
  eref["target"] = href.strip
169
170
  eref.name = presxml ? "fmt-link" : "link"
170
171
  eref.elements&.remove
171
172
  end
172
173
 
174
+ # A cross-member svgmap target composes its anchor as authored
175
+ # (<hotspot>_<doc-stamp>), while the target page's SVG ids carry
176
+ # Vectory's disambiguation index (<hotspot>_<counter>) - the two
177
+ # conventions disagree exactly when the members render separately
178
+ # under staging (iso-10303 run 42346461599: 15 fragments broken).
179
+ # Re-key the anchor through the hotspot anchor index: exact, then the
180
+ # anchor with a known member-suffix stripped. Only same-file
181
+ # re-keys are taken; anything else is left untouched.
182
+ def remap_cross_member_hotspot(href, docid)
183
+ href =~ /\A([^#]+\.html)#(.+)\z/ or return href
184
+ file, anchor = Regexp.last_match(1), Regexp.last_match(2)
185
+ rec = hotspot_anchor_index[anchor] ||
186
+ hotspot_anchor_index[hotspot_anchor_base(anchor, docid)] or
187
+ return href
188
+ target = hotspot_target_href(rec, docid) or return href
189
+ target.start_with?("#{file}#") ? target : href
190
+ end
191
+
173
192
  # Re-key svgmap xref targets whose anchor lives outside the current
174
193
  # section page. The svg_xrefs pass composes these targets as
175
194
  # +<xref target='anchor_suffix'/>+ from the SVG hotspot hrefs, naming
@@ -337,16 +356,30 @@ module Metanorma
337
356
  else
338
357
  id
339
358
  end
340
- if !idx.key?(base)
341
- idx[base] = { key: key, id: final, url: url }
342
- elsif idx[base] && idx[base][:id] != final
343
- idx[base] = nil
344
- end
359
+ register_hotspot_base(idx, base, key: key, id: final, url: url)
360
+ # SVG ids additionally carry Vectory's disambiguation index
361
+ # (<orig>_<counter>): the stored id is the assigned form, while
362
+ # cross-member svgmap links compose the anchor from the authored
363
+ # original. Register the original as a second base candidate;
364
+ # the ambiguity guard still nils true collisions.
365
+ stripped = base.sub(/_\d+\z/, "")
366
+ register_hotspot_base(idx, stripped, key: key, id: final,
367
+ url: url) if stripped != base
345
368
  end
346
369
  end
347
370
  idx
348
371
  end
349
372
 
373
+ def register_hotspot_base(idx, base, record)
374
+ return if base.empty?
375
+
376
+ if !idx.key?(base)
377
+ idx[base] = record
378
+ elsif idx[base] && idx[base][:id] != record[:id]
379
+ idx[base] = nil
380
+ end
381
+ end
382
+
350
383
  # The member page's URL relative to the page being rendered; the index
351
384
  # stores it collection-root-relative.
352
385
  def hotspot_relative_url(url, docid)
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "2.5.17".freeze
2
+ VERSION = "2.5.18".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.17
4
+ version: 2.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor