isodoc 1.7.2 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +2 -0
- data/lib/isodoc/convert.rb +1 -0
- data/lib/isodoc/css.rb +3 -3
- data/lib/isodoc/function/blocks_example_note.rb +85 -79
- data/lib/isodoc/function/cleanup.rb +181 -175
- data/lib/isodoc/function/inline.rb +110 -108
- data/lib/isodoc/function/inline_simple.rb +55 -55
- data/lib/isodoc/function/lists.rb +75 -71
- data/lib/isodoc/function/references.rb +165 -160
- data/lib/isodoc/function/reqt.rb +91 -85
- data/lib/isodoc/function/section.rb +140 -190
- data/lib/isodoc/function/section_titles.rb +82 -0
- data/lib/isodoc/function/table.rb +90 -87
- data/lib/isodoc/function/terms.rb +58 -56
- data/lib/isodoc/function/to_word_html.rb +2 -0
- data/lib/isodoc/html_function/mathvariant_to_plain.rb +5 -3
- data/lib/isodoc/presentation_function/block.rb +80 -53
- data/lib/isodoc/presentation_function/inline.rb +48 -16
- data/lib/isodoc/presentation_function/math.rb +9 -0
- data/lib/isodoc/presentation_function/section.rb +12 -1
- data/lib/isodoc/presentation_xml_convert.rb +3 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +5 -5
- data/lib/isodoc/xslfo_convert.rb +2 -2
- data/lib/isodoc.rb +1 -1
- data/spec/assets/outputtest/iso.international-standard.xsl +2 -2
- data/spec/isodoc/blocks_spec.rb +178 -64
- data/spec/isodoc/inline_spec.rb +230 -123
- data/spec/isodoc/postproc_spec.rb +2 -2
- data/spec/isodoc/presentation_xml_spec.rb +84 -0
- data/spec/isodoc/section_spec.rb +764 -0
- data/spec/isodoc/terms_spec.rb +116 -0
- metadata +31 -2
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -209,8 +209,7 @@ RSpec.describe IsoDoc do
|
|
209
209
|
<renderterm>word</renderterm>
|
210
210
|
<termref base='IEV' target='135-13-13'>The IEV database</termref>
|
211
211
|
</concept></li>
|
212
|
-
<li><concept
|
213
|
-
<renderterm>word</renderterm>
|
212
|
+
<li><concept>
|
214
213
|
<strong>error!</strong>
|
215
214
|
</concept>
|
216
215
|
</li>
|
@@ -295,7 +294,7 @@ RSpec.describe IsoDoc do
|
|
295
294
|
<li>
|
296
295
|
<em>word</em> [<termref base="IEV" target="135-13-13">The IEV database</termref>]
|
297
296
|
</li>
|
298
|
-
<li> <
|
297
|
+
<li> <strong>error!</strong> </li>
|
299
298
|
</ul>
|
300
299
|
</p>
|
301
300
|
</foreword></preface>
|
@@ -380,7 +379,7 @@ RSpec.describe IsoDoc do
|
|
380
379
|
<i>word</i>
|
381
380
|
[The IEV database]
|
382
381
|
</li>
|
383
|
-
<li> <
|
382
|
+
<li> <b>error!</b> </li>
|
384
383
|
</ul>
|
385
384
|
</p>
|
386
385
|
</div>
|
@@ -418,31 +417,22 @@ RSpec.describe IsoDoc do
|
|
418
417
|
<preface><foreword>
|
419
418
|
<p>
|
420
419
|
<ul>
|
421
|
-
<li>
|
422
|
-
<concept
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
<li><concept ital="true" ref="true"><refterm>term</refterm>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
</concept></li>
|
438
|
-
<li><concept ref="false"><refterm>term</refterm>
|
439
|
-
<renderterm>term</renderterm>
|
440
|
-
<xref target='clause1'/>
|
441
|
-
</concept></li>
|
442
|
-
<li><concept ital="false" ref="false"><refterm>term</refterm>
|
443
|
-
<renderterm>term</renderterm>
|
444
|
-
<xref target='clause1'/>
|
445
|
-
</concept></li>
|
420
|
+
<li><concept ital="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
421
|
+
<li><concept ref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
422
|
+
<li><concept ital="true" ref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
423
|
+
<li><concept ital="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
424
|
+
<li><concept ref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
425
|
+
<li><concept ital="false" ref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
426
|
+
<li><concept ital="true" ref="true" linkmention="true" linkref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
427
|
+
<li><concept ital="true" ref="true" linkmention="true" linkref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
428
|
+
<li><concept ital="true" ref="true" linkmention="false" linkref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
429
|
+
<li><concept ital="true" ref="true" linkmention="false" linkref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept>,</li>
|
430
|
+
<li><concept ital="true" ref="true" linkmention="true" linkref="true"><strong>error!</strong></concept></li>
|
431
|
+
<li><concept ital="false" ref="false" linkmention="true">
|
432
|
+
<refterm>CV_DiscreteCoverage</refterm>
|
433
|
+
<renderterm>CV_DiscreteCoverage</renderterm>
|
434
|
+
<xref target="term-cv_discretecoverage"/>
|
435
|
+
</concept></li>
|
446
436
|
</ul></p>
|
447
437
|
</foreword></preface>
|
448
438
|
<sections>
|
@@ -451,86 +441,99 @@ RSpec.describe IsoDoc do
|
|
451
441
|
</iso-standard>
|
452
442
|
INPUT
|
453
443
|
presxml = <<~OUTPUT
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
<em>term</em>
|
477
|
-
|
478
|
-
</li>
|
479
|
-
<li>
|
480
|
-
term
|
481
|
-
|
482
|
-
</li>
|
483
|
-
</ul></p>
|
484
|
-
</foreword></preface>
|
485
|
-
<sections>
|
486
|
-
<clause id="clause1" displayorder="2"><title depth="1">1.<tab/>Clause 1</title></clause>
|
487
|
-
</sections>
|
488
|
-
</iso-standard>
|
444
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
445
|
+
<preface><foreword displayorder="1">
|
446
|
+
<p>
|
447
|
+
<ul>
|
448
|
+
<li><em>term</em> [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
449
|
+
<li><em>term</em> [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
450
|
+
<li><em>term</em> [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
451
|
+
<li>term [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
452
|
+
<li><em>term</em>,</li>
|
453
|
+
<li>term,</li>
|
454
|
+
<li><xref target="clause1"><em>term</em></xref> [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
455
|
+
<li><xref target="clause1"><em>term</em></xref> [term defined in Clause 1],</li>
|
456
|
+
<li><em>term</em> [term defined in <xref target="clause1">Clause 1</xref>],</li>
|
457
|
+
<li><em>term</em> [term defined in Clause 1],</li>
|
458
|
+
<li><strong>error!</strong></li>
|
459
|
+
<li><xref target='term-cv_discretecoverage'>CV_DiscreteCoverage</xref></li>
|
460
|
+
</ul></p>
|
461
|
+
</foreword></preface>
|
462
|
+
<sections>
|
463
|
+
<clause id="clause1" displayorder="2"><title depth="1">1.<tab/>Clause 1</title></clause>
|
464
|
+
</sections>
|
465
|
+
</iso-standard>
|
489
466
|
OUTPUT
|
490
467
|
output = <<~OUTPUT
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
468
|
+
#{HTML_HDR}
|
469
|
+
<br/>
|
470
|
+
<div>
|
471
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
472
|
+
<p>
|
473
|
+
<ul>
|
474
|
+
<li>
|
475
|
+
<i>term</i>
|
476
|
+
[term defined in
|
477
|
+
<a href='#clause1'>Clause 1</a>
|
478
|
+
],
|
479
|
+
</li>
|
480
|
+
<li>
|
481
|
+
<i>term</i>
|
482
|
+
[term defined in
|
483
|
+
<a href='#clause1'>Clause 1</a>
|
484
|
+
],
|
485
|
+
</li>
|
486
|
+
<li>
|
487
|
+
<i>term</i>
|
488
|
+
[term defined in
|
489
|
+
<a href='#clause1'>Clause 1</a>
|
490
|
+
],
|
491
|
+
</li>
|
492
|
+
<li>
|
493
|
+
term [term defined in
|
494
|
+
<a href='#clause1'>Clause 1</a>
|
495
|
+
],
|
496
|
+
</li>
|
497
|
+
<li>
|
498
|
+
<i>term</i>,
|
499
|
+
</li>
|
500
|
+
<li>term,</li>
|
501
|
+
<li>
|
502
|
+
<a href='#clause1'>
|
503
|
+
<i>term</i>
|
504
|
+
</a>
|
505
|
+
[term defined in
|
506
|
+
<a href='#clause1'>Clause 1</a>
|
507
|
+
],
|
508
|
+
</li>
|
509
|
+
<li>
|
510
|
+
<a href='#clause1'>
|
511
|
+
<i>term</i>
|
512
|
+
</a>
|
513
|
+
[term defined in Clause 1],
|
514
|
+
</li>
|
515
|
+
<li>
|
516
|
+
<i>term</i>
|
517
|
+
[term defined in
|
518
|
+
<a href='#clause1'>Clause 1</a>
|
519
|
+
],
|
520
|
+
</li>
|
521
|
+
<li>
|
522
|
+
<i>term</i>
|
523
|
+
[term defined in Clause 1],
|
524
|
+
</li>
|
525
|
+
<li> <b>error!</b> </li>
|
526
|
+
<li> <a href='#term-cv_discretecoverage'>CV_DiscreteCoverage</a> </li>
|
527
|
+
</ul>
|
528
|
+
</p>
|
529
|
+
</div>
|
530
|
+
<p class='zzSTDTitle1'/>
|
531
|
+
<div id='clause1'>
|
532
|
+
<h1>1.  Clause 1</h1>
|
533
|
+
</div>
|
534
|
+
</div>
|
535
|
+
</body>
|
536
|
+
</html>
|
534
537
|
OUTPUT
|
535
538
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
536
539
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
@@ -855,6 +858,102 @@ RSpec.describe IsoDoc do
|
|
855
858
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
856
859
|
end
|
857
860
|
|
861
|
+
it "duplicates MathML with AsciiMath" do
|
862
|
+
input = <<~INPUT
|
863
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" xmlns:m='http://www.w3.org/1998/Math/MathML'>
|
864
|
+
<preface><foreword>
|
865
|
+
<p>
|
866
|
+
<stem type="MathML"><m:math>
|
867
|
+
<m:msup> <m:mrow> <m:mo>(</m:mo> <m:mrow> <m:mi>x</m:mi> <m:mo>+</m:mo> <m:mi>y</m:mi> </m:mrow> <m:mo>)</m:mo> </m:mrow> <m:mn>2</m:mn> </m:msup>
|
868
|
+
</m:math></stem>
|
869
|
+
</p>
|
870
|
+
</foreword></preface>
|
871
|
+
<sections>
|
872
|
+
</iso-standard>
|
873
|
+
INPUT
|
874
|
+
output = <<~OUTPUT
|
875
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' xmlns:m='http://www.w3.org/1998/Math/MathML' type='presentation'>
|
876
|
+
<preface>
|
877
|
+
<foreword displayorder='1'>
|
878
|
+
<p>
|
879
|
+
<stem type='MathML'>
|
880
|
+
<m:math>
|
881
|
+
<m:msup>
|
882
|
+
<m:mrow>
|
883
|
+
<m:mo>(</m:mo>
|
884
|
+
<m:mrow>
|
885
|
+
<m:mi>x</m:mi>
|
886
|
+
<m:mo>+</m:mo>
|
887
|
+
<m:mi>y</m:mi>
|
888
|
+
</m:mrow>
|
889
|
+
<m:mo>)</m:mo>
|
890
|
+
</m:mrow>
|
891
|
+
<m:mn>2</m:mn>
|
892
|
+
</m:msup>
|
893
|
+
</m:math>
|
894
|
+
<comment> ( x + y )^2 </comment>
|
895
|
+
</stem>
|
896
|
+
</p>
|
897
|
+
</foreword>
|
898
|
+
</preface>
|
899
|
+
<sections> </sections>
|
900
|
+
</iso-standard>
|
901
|
+
OUTPUT
|
902
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
903
|
+
.convert("test", input, true)
|
904
|
+
.gsub("<!--", "<comment>")
|
905
|
+
.gsub("-->", "</comment>")))
|
906
|
+
.to be_equivalent_to xmlpp(output)
|
907
|
+
end
|
908
|
+
|
909
|
+
it "overrides duplication of MathML with AsciiMath" do
|
910
|
+
input = <<~INPUT
|
911
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" xmlns:m='http://www.w3.org/1998/Math/MathML'>
|
912
|
+
<preface><foreword>
|
913
|
+
<p>
|
914
|
+
<stem type="MathML"><m:math>
|
915
|
+
<m:msup> <m:mrow> <m:mo>(</m:mo> <m:mrow> <m:mi>x</m:mi> <m:mo>+</m:mo> <m:mi>y</m:mi> </m:mrow> <m:mo>)</m:mo> </m:mrow> <m:mn>2</m:mn> </m:msup>
|
916
|
+
</m:math></stem>
|
917
|
+
</p>
|
918
|
+
</foreword></preface>
|
919
|
+
<sections>
|
920
|
+
</iso-standard>
|
921
|
+
INPUT
|
922
|
+
output = <<~OUTPUT
|
923
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' xmlns:m='http://www.w3.org/1998/Math/MathML' type='presentation'>
|
924
|
+
<preface>
|
925
|
+
<foreword displayorder='1'>
|
926
|
+
<p>
|
927
|
+
<stem type='MathML'>
|
928
|
+
<m:math>
|
929
|
+
<m:msup>
|
930
|
+
<m:mrow>
|
931
|
+
<m:mo>(</m:mo>
|
932
|
+
<m:mrow>
|
933
|
+
<m:mi>x</m:mi>
|
934
|
+
<m:mo>+</m:mo>
|
935
|
+
<m:mi>y</m:mi>
|
936
|
+
</m:mrow>
|
937
|
+
<m:mo>)</m:mo>
|
938
|
+
</m:mrow>
|
939
|
+
<m:mn>2</m:mn>
|
940
|
+
</m:msup>
|
941
|
+
</m:math>
|
942
|
+
</stem>
|
943
|
+
</p>
|
944
|
+
</foreword>
|
945
|
+
</preface>
|
946
|
+
<sections> </sections>
|
947
|
+
</iso-standard>
|
948
|
+
OUTPUT
|
949
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
950
|
+
.new({ suppressasciimathdup: "true" })
|
951
|
+
.convert("test", input, true)
|
952
|
+
.gsub("<!--", "<comment>")
|
953
|
+
.gsub("-->", "</comment>")))
|
954
|
+
.to be_equivalent_to xmlpp(output)
|
955
|
+
end
|
956
|
+
|
858
957
|
it "processes eref types" do
|
859
958
|
input = <<~INPUT
|
860
959
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -881,22 +980,27 @@ RSpec.describe IsoDoc do
|
|
881
980
|
INPUT
|
882
981
|
output = <<~OUTPUT
|
883
982
|
#{HTML_HDR}
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
</
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
983
|
+
<br/>
|
984
|
+
<div>
|
985
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
986
|
+
<p>
|
987
|
+
<sup>
|
988
|
+
<a href='#ISO712'>A</a>
|
989
|
+
</sup>
|
990
|
+
<a href='#ISO712'>A</a>
|
991
|
+
</p>
|
992
|
+
</div>
|
993
|
+
<p class='zzSTDTitle1'/>
|
994
|
+
<div>
|
995
|
+
<h1>Normative References</h1>
|
996
|
+
<p id='ISO712' class='NormRef'>
|
997
|
+
ISO 712,
|
998
|
+
<i>Cereals and cereal products</i>
|
999
|
+
</p>
|
1000
|
+
</div>
|
1001
|
+
</div>
|
1002
|
+
</body>
|
1003
|
+
</html>
|
900
1004
|
OUTPUT
|
901
1005
|
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
902
1006
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
@@ -919,6 +1023,7 @@ RSpec.describe IsoDoc do
|
|
919
1023
|
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
920
1024
|
<eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
|
921
1025
|
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
1026
|
+
<eref type="inline" bibitemid="ISO712"><locality type="locality:URI"><referenceFrom>7</referenceFrom></locality></eref>
|
922
1027
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
923
1028
|
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
|
924
1029
|
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
@@ -957,6 +1062,7 @@ RSpec.describe IsoDoc do
|
|
957
1062
|
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
958
1063
|
<eref type="inline" bibitemid="ISO712"><locality type="whole"/>ISO 712, Whole of text</eref>
|
959
1064
|
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality>ISO 712, Prelude 7</eref>
|
1065
|
+
<eref type="inline" bibitemid="ISO712"><locality type="locality:URI"><referenceFrom>7</referenceFrom></locality>ISO 712, URI 7</eref>
|
960
1066
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
961
1067
|
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality>ISO 712</eref>
|
962
1068
|
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
|
@@ -999,6 +1105,7 @@ RSpec.describe IsoDoc do
|
|
999
1105
|
<a href="#ISO712">A</a>
|
1000
1106
|
<a href="#ISO712">ISO 712, Whole of text</a>
|
1001
1107
|
<a href="#ISO712">ISO 712, Prelude 7</a>
|
1108
|
+
<a href="#ISO712">ISO 712, URI 7</a>
|
1002
1109
|
<a href="#ISO712">A</a>
|
1003
1110
|
<a href='#ISO712'>ISO 712</a>
|
1004
1111
|
<a href='#ISO712'>ISO 712, Clause 1</a>
|
@@ -245,7 +245,7 @@ RSpec.describe IsoDoc do
|
|
245
245
|
html = File.read("test.html")
|
246
246
|
expect(html).to match(/another empty stylesheet/)
|
247
247
|
expect(html).to match(/p \{[^}]*?font-family: Arial/m)
|
248
|
-
expect(html).to match(/code \{[^}]*?font-family: Courier/m)
|
248
|
+
expect(html).to match(/code \{[^}]*?font-family: Courier New/m)
|
249
249
|
expect(html).to match(/h1 \{[^}]*?font-family: Arial/m)
|
250
250
|
expect(html).to match(/p \{[^}]*?font-size: 1em;/m)
|
251
251
|
expect(html).to match(/code \{[^}]*?font-size: 0.8em/m)
|
@@ -329,7 +329,7 @@ RSpec.describe IsoDoc do
|
|
329
329
|
word = File.read("test.doc")
|
330
330
|
expect(word).to match(/another empty stylesheet/)
|
331
331
|
expect(word).to match(/p \{[^}]*?font-family: Arial/m)
|
332
|
-
expect(word).to match(/code \{[^}]*?font-family: Courier/m)
|
332
|
+
expect(word).to match(/code \{[^}]*?font-family: Courier New/m)
|
333
333
|
expect(word).to match(/h1 \{[^}]*?font-family: Arial/m)
|
334
334
|
expect(word).to match(/p \{[^}]*?font-size: 12pt/m)
|
335
335
|
expect(word).to match(/code \{[^}]*?font-size: 11pt/m)
|
@@ -678,6 +678,90 @@ RSpec.describe IsoDoc do
|
|
678
678
|
.to be_equivalent_to xmlpp(output)
|
679
679
|
end
|
680
680
|
|
681
|
+
it "strips variant-title" do
|
682
|
+
input = <<~INPUT
|
683
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
684
|
+
<bibdata/>
|
685
|
+
<sections>
|
686
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
687
|
+
<title>Clause</title>
|
688
|
+
<p id='_'>Text</p>
|
689
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
690
|
+
<title>Subclause</title>
|
691
|
+
<variant-title variant_title='true' type='sub' id='_'>“A” ‘B’</variant-title>
|
692
|
+
<variant-title variant_title='true' type='toc' id='_'>
|
693
|
+
Clause
|
694
|
+
<em>A</em>
|
695
|
+
<stem type='MathML'>
|
696
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
697
|
+
<mi>x</mi>
|
698
|
+
</math>
|
699
|
+
</stem>
|
700
|
+
</variant-title>
|
701
|
+
<p id='_'>Text</p>
|
702
|
+
</clause>
|
703
|
+
</clause>
|
704
|
+
</sections>
|
705
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
706
|
+
<title>Clause</title>
|
707
|
+
<variant-title variant_title='true' type='toc' id='_'>
|
708
|
+
Clause
|
709
|
+
<em>A</em>
|
710
|
+
<stem type='MathML'>
|
711
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
712
|
+
<mi>x</mi>
|
713
|
+
</math>
|
714
|
+
</stem>
|
715
|
+
</variant-title>
|
716
|
+
<p id='_'>Text</p>
|
717
|
+
</annex>
|
718
|
+
</iso-standard>
|
719
|
+
INPUT
|
720
|
+
output = <<~OUTPUT
|
721
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
722
|
+
<bibdata/>
|
723
|
+
<sections>
|
724
|
+
<clause id='_' inline-header='false' obligation='normative' displayorder='1'>
|
725
|
+
<title depth='1'>
|
726
|
+
<strong>Annex A</strong>
|
727
|
+
<br/>
|
728
|
+
(normative).
|
729
|
+
<tab/>
|
730
|
+
Clause
|
731
|
+
</title>
|
732
|
+
<p id='_'>Text</p>
|
733
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
734
|
+
<title depth='1'>
|
735
|
+
<strong>Annex A</strong>
|
736
|
+
<br/>
|
737
|
+
(normative).
|
738
|
+
<tab/>
|
739
|
+
Subclause
|
740
|
+
</title>
|
741
|
+
<variant-title variant_title='true' type='sub' id='_'>“A” ‘B’</variant-title>
|
742
|
+
<p id='_'>Text</p>
|
743
|
+
</clause>
|
744
|
+
</clause>
|
745
|
+
</sections>
|
746
|
+
<annex id='_' inline-header='false' obligation='normative' displayorder='2'>
|
747
|
+
<title>
|
748
|
+
<strong>Annex A</strong>
|
749
|
+
<br/>
|
750
|
+
(normative)
|
751
|
+
<br/>
|
752
|
+
<br/>
|
753
|
+
<strong>Clause</strong>
|
754
|
+
</title>
|
755
|
+
<p id='_'>Text</p>
|
756
|
+
</annex>
|
757
|
+
</iso-standard>
|
758
|
+
OUTPUT
|
759
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
760
|
+
.convert("test", input, true))
|
761
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
762
|
+
.to be_equivalent_to xmlpp(output)
|
763
|
+
end
|
764
|
+
|
681
765
|
private
|
682
766
|
|
683
767
|
def mock_symbols
|