Skip to content

Commit

Permalink
process index/@to: #67
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 18, 2020
1 parent b1c167a commit c9a4fa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/isodoc/bipm/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def extract_indexterms(terms)
v[term][term2] ||= {}
v[term][term2][term3] ||= {}
v[term][term2][term3][:xref] ||= []
v[term][term2][term3][:xref] << "<xref target='#{t['id']}' pagenumber='true'/>"
to = t["to"] ? "to='#{t['to']}' " : ""
v[term][term2][term3][:xref] << "<xref target='#{t['id']}' #{to}pagenumber='true'/>"
end
end

Expand Down
10 changes: 6 additions & 4 deletions spec/isodoc/html_convert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@
</bibdata>
<sections>
<clause id="A">
<index><primary>&#xE9;long&#xE9;</primary></index>
<index to="End"><primary>&#xE9;long&#xE9;</primary></index>
<index><primary>&#xEA;tre</primary><secondary>Husserl</secondary><tertiary>en allemand</tertiary></index>
<index><primary>Emancipation</primary></index>
<index><primary>Emancipation</primary><secondary>dans la France</secondary></index>
Expand All @@ -1748,6 +1748,7 @@
<index-xref also="false"><primary>&#xEA;tre</primary><secondary>Husserl</secondary><target>zebra</target></index-xref>
<index-xref also="false"><primary><em>Dasein</em></primary><target>&#xEA;tre</target></index-xref>
<index-xref also="false"><primary><em>Dasein</em></primary><target>Emancipation</target></index-xref>
<bookmark id="End"/>
</clause>
</clause>
</sections>
Expand All @@ -1759,9 +1760,9 @@
<script current='true'>Latn</script>
</bibdata>
<sections>
<clause id='A'>
<clause id='A'>
<title>1.</title>
<bookmark id='_'/>
<bookmark to='End' id='_'/>
<bookmark id='_'/>
<bookmark id='_'/>
<bookmark id='_'/>
Expand All @@ -1772,6 +1773,7 @@
<bookmark id='_'/>
<bookmark id='_'/>
<bookmark id='_'/>
<bookmark id='End'/>
</clause>
</clause>
</sections>
Expand All @@ -1793,7 +1795,7 @@
<ul>
<li>
&#xE9;long&#xE9;,
<xref target='_' pagenumber='true'>chap&#xEE;tre 1</xref>
<xref target='_' to='End' pagenumber='true'>chap&#xEE;tre 1</xref>
</li>
<li>
Emancipation,
Expand Down

0 comments on commit c9a4fa5

Please sign in to comment.