Skip to content

Commit

Permalink
preserve docidentifier formatting in biblio-tag: metanorma/bipm-si-br…
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 19, 2024
1 parent 1235919 commit 773c959
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/isodoc/presentation_function/docid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def no_identifier(bib)

def bracket_if_num(num)
num.nil? and return nil
num = num.text.sub(/^\[/, "").sub(/\]$/, "")
num = to_xml(num.children).sub(/^\[/, "").sub(/\]$/, "")
/^\d+$/.match?(num) and return "[#{num}]"
num
end

def unbracket1(ident)
ident.nil? and return nil
ident.is_a?(String) or ident = ident.text
ident.is_a?(String) or ident = to_xml(ident.children)
ident.sub(/^\[/, "").sub(/\]$/, "")
end

Expand Down
16 changes: 8 additions & 8 deletions spec/isodoc/ref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@
<docidentifier type="metanorma">[<strong>A</strong>.]</docidentifier>
<docidentifier>XYZ</docidentifier>
<docidentifier scope="biblio-tag">XYZ</docidentifier>
<biblio-tag>A., XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
<biblio-tag><strong>A</strong>., XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
</bibitem>
<p id="_">More text</p>
</references>
Expand Down Expand Up @@ -2030,7 +2030,7 @@
<docidentifier type="metanorma">[<strong>A</strong>.]</docidentifier>
<docidentifier>XYZ</docidentifier>
<docidentifier scope="biblio-tag">XYZ</docidentifier>
<biblio-tag>A., XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
<biblio-tag><strong>A</strong>., XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
</bibitem>
</references>
</clause>
Expand All @@ -2050,7 +2050,7 @@
<docidentifier type="metanorma">[<strong>A</strong>.]</docidentifier>
<docidentifier>XYZ</docidentifier>
<docidentifier scope="biblio-tag">XYZ</docidentifier>
<biblio-tag>A.<tab/>XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
<biblio-tag><strong>A</strong>.<tab/>XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
</bibitem>
<p id="_">More text</p>
</references>
Expand All @@ -2066,7 +2066,7 @@
<docidentifier type="metanorma">[<strong>A</strong>.]</docidentifier>
<docidentifier>XYZ</docidentifier>
<docidentifier scope="biblio-tag">XYZ</docidentifier>
<biblio-tag>A.<tab/>XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
<biblio-tag><strong>A</strong>.<tab/>XYZ<fn reference="1"><p id="_">hello</p></fn>, </biblio-tag>
</bibitem>
</references>
</clause>
Expand Down Expand Up @@ -2094,14 +2094,14 @@
<h1>1.  Normative References</h1>
<p id="_">Text</p>
<div>
<p id="iso122" class="Biblio">A., XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<p id="iso122" class="Biblio"><b>A</b>., XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<i>Standard</i>
</p>
<p id="_">More text</p>
</div>
<div>
<h2 class="Section3">1.1.  Normative 1</h2>
<p id="iso123" class="Biblio">A., XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<p id="iso123" class="Biblio"><b>A</b>., XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<i>Standard</i>
</p>
</div>
Expand All @@ -2111,14 +2111,14 @@
<h1 class="Section3">Bibliography</h1>
<p id="_">Text</p>
<div>
<p id="iso124" class="Biblio">A.  XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<p id="iso124" class="Biblio"><b>A</b>.  XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<i>Standard</i>
</p>
<p id="_">More text</p>
</div>
<div>
<h2 class="Section3">Bibliography 1</h2>
<p id="iso125" class="Biblio">A.  XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<p id="iso125" class="Biblio"><b>A</b>.  XYZ<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>,
<i>Standard</i>
</p>
</div>
Expand Down

0 comments on commit 773c959

Please sign in to comment.