metanorma-standoc 2.0.2 → 2.0.3
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 +4 -4
- data/lib/metanorma/standoc/base.rb +1 -1
- data/lib/metanorma/standoc/basicdoc.rng +5 -3
- data/lib/metanorma/standoc/biblio.rng +5 -3
- data/lib/metanorma/standoc/cleanup_image.rb +117 -3
- data/lib/metanorma/standoc/cleanup_ref.rb +1 -1
- data/lib/metanorma/standoc/cleanup_section.rb +1 -1
- data/lib/metanorma/standoc/cleanup_xref.rb +12 -5
- data/lib/metanorma/standoc/isodoc.rng +10 -0
- data/lib/metanorma/standoc/ref.rb +6 -1
- data/lib/metanorma/standoc/ref_utility.rb +2 -1
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +8 -6
- data/lib/metanorma/standoc/terms.rb +10 -7
- data/lib/metanorma/standoc/validate.rb +7 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- data/spec/metanorma/cleanup_blocks_spec.rb +136 -0
- data/spec/metanorma/cleanup_spec.rb +3 -3
- data/spec/metanorma/isobib_cache_spec.rb +2 -2
- data/spec/metanorma/macros_spec.rb +61 -0
- data/spec/metanorma/refs_spec.rb +505 -460
- data/spec/metanorma/section_spec.rb +1 -1
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +46 -46
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/hide_refs.yml +98 -98
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +35 -35
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +61 -51
- metadata +2 -2
@@ -1522,6 +1522,67 @@ RSpec.describe Metanorma::Standoc do
|
|
1522
1522
|
end
|
1523
1523
|
end
|
1524
1524
|
|
1525
|
+
context "terms with index terms" do
|
1526
|
+
let(:input) do
|
1527
|
+
<<~XML
|
1528
|
+
#{ASCIIDOC_BLANK_HDR}
|
1529
|
+
|
1530
|
+
== Terms and Definitions
|
1531
|
+
|
1532
|
+
=== name(((name)))
|
1533
|
+
|
1534
|
+
== Main
|
1535
|
+
|
1536
|
+
term:[name] is a term
|
1537
|
+
|
1538
|
+
{{name}} is a term
|
1539
|
+
XML
|
1540
|
+
end
|
1541
|
+
let(:output) do
|
1542
|
+
<<~XML
|
1543
|
+
#{BLANK_HDR}
|
1544
|
+
<sections>
|
1545
|
+
<terms id='_' obligation='normative'>
|
1546
|
+
<title>Terms and definitions</title>
|
1547
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1548
|
+
<term id='term-name'>
|
1549
|
+
<preferred><expression><name>name
|
1550
|
+
<index>
|
1551
|
+
<primary>name</primary>
|
1552
|
+
</index>
|
1553
|
+
</name>
|
1554
|
+
</expression></preferred>
|
1555
|
+
</term>
|
1556
|
+
</terms>
|
1557
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1558
|
+
<title>Main</title>
|
1559
|
+
<p id='_'>
|
1560
|
+
<concept>
|
1561
|
+
<refterm>name</refterm>
|
1562
|
+
<renderterm>name</renderterm>
|
1563
|
+
<xref target='term-name'/>
|
1564
|
+
</concept>
|
1565
|
+
is a term
|
1566
|
+
</p>
|
1567
|
+
<p id='_'>
|
1568
|
+
<concept>
|
1569
|
+
<refterm>name</refterm>
|
1570
|
+
<renderterm>name</renderterm>
|
1571
|
+
<xref target='term-name'/>
|
1572
|
+
</concept>
|
1573
|
+
is a term
|
1574
|
+
</p>
|
1575
|
+
</clause>
|
1576
|
+
</sections>
|
1577
|
+
</standard-document>
|
1578
|
+
XML
|
1579
|
+
end
|
1580
|
+
|
1581
|
+
it "strips index terms in terms anchors" do
|
1582
|
+
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
1583
|
+
end
|
1584
|
+
end
|
1585
|
+
|
1525
1586
|
context "multiply exising ids in document" do
|
1526
1587
|
let(:input) do
|
1527
1588
|
<<~XML
|