Skip to content

Commit

Permalink
https://github.com/metanorma/isodoc/issues/617
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 3, 2024
1 parent 25a3d38 commit 11725f2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/isodoc/iso/xref_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def section_name_anchors(clause, num, level)
end

def annex_name_anchors1(clause, num, level)
ret = { label: num , #semx(clause, num),
level: level, subtype: "annex" }
level == 1 and return annex_name_anchors(clause, num, level)
ret = { label: num, level: level, subtype: "annex" }
ret2 = if level == 2
xref = labelled_autonum(@labels["clause"], num)
{ xref:, # l10n("#{@labels['clause']} #{num}"),
Expand All @@ -65,15 +65,6 @@ def annex_name_anchors1(clause, num, level)
@anchors[clause["id"]] = ret.merge(ret2)
end

def annex_names1(clause, parentnum, num, level)
lbl = clause_number_semx(parentnum, clause, num)
annex_name_anchors1(clause, lbl, level)
i = clause_counter(0)
clause.xpath(ns("./clause | ./references")).each do |c|
annex_names1(c, lbl, i.increment(c).print, level + 1)
end
end

def appendix_names1(clause, parentnum, num, level, container)
#num = labelled_autonum(@labels["appendix"], num)
num = clause_number_semx(parentnum, clause, num)
Expand Down
28 changes: 28 additions & 0 deletions spec/isodoc/xref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,9 @@
<xref target="Q2"/>
<xref target="Q3"/>
<xref target="Q4"/>
<xref target="QQ"/>
<xref target="QQ1"/>
<xref target="QQ2"/>
<xref target="R"/></p>
</foreword>
<introduction id="B" obligation="informative">
Expand Down Expand Up @@ -1181,6 +1184,11 @@
</clause>
</appendix>
</annex>
<annex id="QQ">
<terms id="QQ1">
<term id="QQ2"/>
</terms>
</annex>
<bibliography>
<references id="R" normative="true" obligation="informative">
<title>Normative References</title>
Expand Down Expand Up @@ -1334,6 +1342,26 @@
<semx element="autonum" source="Q3">1</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="Q4">1</semx>
</xref>
<xref target="QQ">
<span class="citeapp">
<span class="fmt-element-name">Annex</span>
<semx element="autonum" source="QQ">B</semx>
</span>
</xref>
<xref target="QQ1">
<span class="citeapp">
<span class="fmt-element-name">Annex</span>
<semx element="autonum" source="QQ1">B</semx>
</span>
</xref>
<xref target="QQ2">
<span class="citeapp">
<span class="fmt-element-name">Clause</span>
<semx element="autonum" source="QQ1">B</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="QQ2">1</semx>
</span>
</xref>
<xref target="R">
<span class="citesec">
Expand Down

0 comments on commit 11725f2

Please sign in to comment.