Skip to content

Commit 137edfd

Browse files
authoredNov 28, 2023
Merge pull request #217 from metanorma/fix/recursive-prefix-container
allow recursive container prefixes for cross-references: https://gith…
2 parents d68c903 + 38b11b9 commit 137edfd

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed
 

‎Gemfile.devel

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/recursive-prefix-container"

‎lib/isodoc/un/xref.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ def clause_order_back(_docxml)
159159
]
160160
end
161161

162-
def sequential_admonition_names(clause)
162+
def sequential_admonition_names(clause, container: false)
163163
i = 0
164164
clause.xpath(ns(".//admonition")).noblank.each do |t|
165165
i += 1 unless t["unnumbered"] == "true"
166-
@anchors[t["id"]] = anchor_struct(i.to_s, nil, @labels["admonition"],
166+
@anchors[t["id"]] =
167+
anchor_struct(i.to_s, container ? t : nil, @labels["admonition"],
167168
"box", t["unnumbered"])
168169
end
169170
end
@@ -178,9 +179,9 @@ def hierarchical_admonition_names(clause, num)
178179
end
179180
end
180181

181-
def sequential_asset_names(clause)
182+
def sequential_asset_names(clause, container: false)
182183
super
183-
sequential_admonition_names(clause)
184+
sequential_admonition_names(clause, container: container)
184185
end
185186

186187
def hierarchical_asset_names(clause, num)

‎lib/metanorma/un/biblio.rng

+13
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,16 @@
374374
<ref name="image"/>
375375
</element>
376376
</define>
377+
<define name="depiction">
378+
<element name="depiction">
379+
<optional>
380+
<attribute name="scope"/>
381+
</optional>
382+
<zeroOrMore>
383+
<ref name="image"/>
384+
</zeroOrMore>
385+
</element>
386+
</define>
377387
<define name="NameWithVariants">
378388
<element name="primary">
379389
<ref name="LocalizedString"/>
@@ -760,6 +770,9 @@
760770
<optional>
761771
<ref name="validity"/>
762772
</optional>
773+
<optional>
774+
<ref name="depiction"/>
775+
</optional>
763776
</define>
764777
<define name="ReducedBibliographicItem">
765778
<optional>

0 commit comments

Comments
 (0)
Please sign in to comment.