metanorma-standoc 1.10.6 → 1.11.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +19 -23
  3. data/Rakefile +1 -1
  4. data/lib/asciidoctor/standoc/base.rb +10 -17
  5. data/lib/asciidoctor/standoc/basicdoc.rng +21 -4
  6. data/lib/asciidoctor/standoc/blocks.rb +23 -23
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +17 -22
  8. data/lib/asciidoctor/standoc/cleanup.rb +46 -12
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +3 -71
  10. data/lib/asciidoctor/standoc/cleanup_image.rb +6 -7
  11. data/lib/asciidoctor/standoc/cleanup_inline.rb +42 -106
  12. data/lib/asciidoctor/standoc/cleanup_maths.rb +5 -6
  13. data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -0
  14. data/lib/asciidoctor/standoc/cleanup_reqt.rb +5 -24
  15. data/lib/asciidoctor/standoc/cleanup_section_names.rb +5 -5
  16. data/lib/asciidoctor/standoc/cleanup_symbols.rb +48 -0
  17. data/lib/asciidoctor/standoc/cleanup_table.rb +68 -0
  18. data/lib/asciidoctor/standoc/cleanup_terms.rb +37 -77
  19. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +162 -0
  20. data/lib/asciidoctor/standoc/cleanup_text.rb +5 -2
  21. data/lib/asciidoctor/standoc/cleanup_xref.rb +107 -0
  22. data/lib/asciidoctor/standoc/converter.rb +14 -0
  23. data/lib/asciidoctor/standoc/inline.rb +7 -5
  24. data/lib/asciidoctor/standoc/isodoc.rng +419 -77
  25. data/lib/asciidoctor/standoc/lists.rb +15 -15
  26. data/lib/asciidoctor/standoc/macros.rb +14 -43
  27. data/lib/asciidoctor/standoc/macros_note.rb +45 -0
  28. data/lib/asciidoctor/standoc/macros_plantuml.rb +29 -14
  29. data/lib/asciidoctor/standoc/macros_terms.rb +55 -8
  30. data/lib/asciidoctor/standoc/ref_sect.rb +26 -18
  31. data/lib/asciidoctor/standoc/reqt.rng +23 -2
  32. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +50 -11
  33. data/lib/asciidoctor/standoc/terms.rb +12 -2
  34. data/lib/asciidoctor/standoc/utils.rb +36 -23
  35. data/lib/asciidoctor/standoc/validate.rb +45 -27
  36. data/lib/asciidoctor/standoc/validate_section.rb +5 -2
  37. data/lib/metanorma/standoc/version.rb +1 -1
  38. data/metanorma-standoc.gemspec +1 -1
  39. data/spec/asciidoctor/base_spec.rb +4 -36
  40. data/spec/asciidoctor/blank_spec.rb +37 -0
  41. data/spec/asciidoctor/blocks_spec.rb +208 -49
  42. data/spec/asciidoctor/cleanup_sections_spec.rb +153 -12
  43. data/spec/asciidoctor/cleanup_spec.rb +104 -285
  44. data/spec/asciidoctor/cleanup_terms_spec.rb +990 -0
  45. data/spec/asciidoctor/inline_spec.rb +38 -2
  46. data/spec/asciidoctor/lists_spec.rb +6 -6
  47. data/spec/asciidoctor/macros_plantuml_spec.rb +37 -2
  48. data/spec/asciidoctor/macros_spec.rb +191 -114
  49. data/spec/asciidoctor/refs_spec.rb +12 -30
  50. data/spec/asciidoctor/section_spec.rb +18 -18
  51. data/spec/asciidoctor/validate_spec.rb +87 -2
  52. data/spec/fixtures/datamodel_description_sections_tree.xml +3 -2
  53. data/spec/spec_helper.rb +6 -7
  54. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +51 -51
  55. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +13 -13
  56. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  57. data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
  58. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
  59. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
  60. data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
  61. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +16 -16
  62. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +51 -49
  63. metadata +12 -5
@@ -72,7 +72,7 @@ RSpec.describe Asciidoctor::Standoc do
72
72
  #{ASCIIDOC_BLANK_HDR}
73
73
 
74
74
  [[ABC]]
75
- [stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
75
+ [stem%inequality,number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
76
76
  ++++
77
77
  r = 1 %
78
78
  r = 1 %
@@ -97,7 +97,7 @@ RSpec.describe Asciidoctor::Standoc do
97
97
  output = <<~OUTPUT
98
98
  #{BLANK_HDR}
99
99
  <sections>
100
- <formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
100
+ <formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true' tag='X' multilingual-rendering='common'>
101
101
  <stem type='MathML'>
102
102
  <math xmlns='http://www.w3.org/1998/Math/MathML'>
103
103
  <mi>r</mi>
@@ -353,10 +353,11 @@ RSpec.describe Asciidoctor::Standoc do
353
353
  <title>Terms and definitions</title>
354
354
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
355
355
  <term id='term-term1'>
356
- <preferred>Term1</preferred>
356
+ <preferred><expression><name>Term1</name></expression></preferred>
357
357
  <definition>
358
+ <verbaldefinition>
358
359
  <p id='_'>first definition</p>
359
- <termsource status='identical'>
360
+ <termsource status='identical' type="authoritative">
360
361
  <origin bibitemid='ISO2191' type='inline' citeas=''>
361
362
  <localityStack>
362
363
  <locality type='section'>
@@ -365,10 +366,12 @@ RSpec.describe Asciidoctor::Standoc do
365
366
  </localityStack>
366
367
  </origin>
367
368
  </termsource>
369
+ </verbaldefinition>
368
370
  </definition>
369
371
  <definition>
372
+ <verbaldefinition>
370
373
  <p id='_'>second definition</p>
371
- <termsource status='identical'>
374
+ <termsource status='identical' type="authoritative">
372
375
  <origin bibitemid='ISO2191' type='inline' citeas=''>
373
376
  <localityStack>
374
377
  <locality type='section'>
@@ -377,11 +380,12 @@ RSpec.describe Asciidoctor::Standoc do
377
380
  </localityStack>
378
381
  </origin>
379
382
  </termsource>
383
+ </verbaldefinition>
380
384
  </definition>
381
385
  <termnote id='_'>
382
386
  <p id='_'>This is a note</p>
383
387
  </termnote>
384
- <termsource status='identical'>
388
+ <termsource status='identical' type="authoritative">
385
389
  <origin bibitemid='ISO2191' type='inline' citeas=''>
386
390
  <localityStack>
387
391
  <locality type='section'>
@@ -408,7 +412,7 @@ RSpec.describe Asciidoctor::Standoc do
408
412
 
409
413
  NOTE: This is a note
410
414
 
411
- [NOTE,keep-separate=true]
415
+ [NOTE,keep-separate=true,tag=X,multilingual-rendering=common]
412
416
  ====
413
417
  XYZ
414
418
  ====
@@ -420,11 +424,11 @@ RSpec.describe Asciidoctor::Standoc do
420
424
  <title>Terms and definitions</title>
421
425
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
422
426
  <term id="term-term1">
423
- <preferred>Term1</preferred>
427
+ <preferred><expression><name>Term1</name></expression></preferred>
424
428
  <termnote id="_">
425
429
  <p id="_">This is a note</p>
426
430
  </termnote>
427
- <termnote id='_'>
431
+ <termnote id='_' tag='X' multilingual-rendering='common'>
428
432
  <p id='_'>XYZ</p>
429
433
  </termnote>
430
434
  </term>
@@ -495,7 +499,7 @@ RSpec.describe Asciidoctor::Standoc do
495
499
  <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
496
500
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
497
501
  <term id="term-term1">
498
- <preferred>Term1</preferred>
502
+ <preferred><expression><name>Term1</name></expression></preferred>
499
503
  </term>
500
504
  <definitions id="_" obligation="normative" type="symbols">
501
505
  <title>Symbols</title>
@@ -520,7 +524,7 @@ RSpec.describe Asciidoctor::Standoc do
520
524
  [[ABC]]
521
525
  NOTE: This is a note
522
526
 
523
- [NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified]
527
+ [NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified,tag=X,multilingual-rendering=common]
524
528
  ====
525
529
  XYZ
526
530
  ====
@@ -533,7 +537,7 @@ RSpec.describe Asciidoctor::Standoc do
533
537
  <p id="_">This is a note</p>
534
538
  </note>
535
539
  </foreword></preface><sections>
536
- <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
540
+ <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified" tag='X' multilingual-rendering='common'>
537
541
  <p id='_'>XYZ</p>
538
542
  </note>
539
543
  <clause id="_" inline-header="false" obligation="normative">
@@ -555,7 +559,7 @@ RSpec.describe Asciidoctor::Standoc do
555
559
  #{ASCIIDOC_BLANK_HDR}
556
560
 
557
561
  [[ABC]]
558
- [alt=Literal,keep-with-next=true,keep-lines-together=true]
562
+ [alt=Literal,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
559
563
  ....
560
564
  <LITERAL>
561
565
  FIGURATIVE
@@ -564,7 +568,7 @@ RSpec.describe Asciidoctor::Standoc do
564
568
  output = <<~OUTPUT
565
569
  #{BLANK_HDR}
566
570
  <sections>
567
- <figure id="ABC" keep-with-next="true" keep-lines-together="true">
571
+ <figure id="ABC" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
568
572
  <pre alt="Literal" id="_">&lt;LITERAL&gt;
569
573
  FIGURATIVE
570
574
  </pre>
@@ -601,7 +605,7 @@ RSpec.describe Asciidoctor::Standoc do
601
605
  #{ASCIIDOC_BLANK_HDR}
602
606
 
603
607
  [[ABC]]
604
- [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
608
+ [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true",tag=X,multilingual-rendering=common]
605
609
  .Precautions
606
610
  ====
607
611
  While werewolves are hardy community members, keep in mind the following dietary concerns:
@@ -614,7 +618,7 @@ RSpec.describe Asciidoctor::Standoc do
614
618
  output = <<~OUTPUT
615
619
  #{BLANK_HDR}
616
620
  <sections>
617
- <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
621
+ <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
618
622
  <name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
619
623
  <ol id="_" type="arabic">
620
624
  <li>
@@ -643,7 +647,7 @@ RSpec.describe Asciidoctor::Standoc do
643
647
  === Term1
644
648
 
645
649
  [[ABC]]
646
- [example]
650
+ [example,tag=X,multilingual-rendering=common]
647
651
  This is an example
648
652
  INPUT
649
653
  output = <<~OUTPUT
@@ -653,8 +657,8 @@ RSpec.describe Asciidoctor::Standoc do
653
657
  <title>Terms and definitions</title>
654
658
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
655
659
  <term id="term-term1">
656
- <preferred>Term1</preferred>
657
- <termexample id="ABC">
660
+ <preferred><expression><name>Term1</name></expression></preferred>
661
+ <termexample id="ABC" tag='X' multilingual-rendering='common'>
658
662
  <p id="_">This is an example</p>
659
663
  </termexample></term>
660
664
  </terms>
@@ -713,7 +717,7 @@ RSpec.describe Asciidoctor::Standoc do
713
717
  <sections>
714
718
  <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
715
719
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
716
- <preferred>Term1</preferred>
720
+ <preferred><expression><name>Term1</name></expression></preferred>
717
721
  </term>
718
722
  <definitions id="_" obligation="normative" type="symbols">
719
723
  <title>Symbols</title>
@@ -733,7 +737,7 @@ RSpec.describe Asciidoctor::Standoc do
733
737
  #{ASCIIDOC_BLANK_HDR}
734
738
 
735
739
  [[ABC]]
736
- [example,subsequence=A,keep-with-next=true,keep-lines-together=next]
740
+ [example,subsequence=A,keep-with-next=true,keep-lines-together=next,tag=X,multilingual-rendering=common]
737
741
  .Title
738
742
  ====
739
743
  This is an example
@@ -754,7 +758,7 @@ RSpec.describe Asciidoctor::Standoc do
754
758
  output = <<~OUTPUT
755
759
  #{BLANK_HDR}
756
760
  <sections>
757
- <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
761
+ <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next' tag='X' multilingual-rendering='common'>
758
762
  <name>Title</name>
759
763
  <p id="_">This is an example</p>
760
764
  <p id="_">Amen</p></example>
@@ -940,7 +944,7 @@ RSpec.describe Asciidoctor::Standoc do
940
944
  it "accepts attributes on images" do
941
945
  input = <<~INPUT
942
946
  #{ASCIIDOC_BLANK_HDR}
943
- [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
947
+ [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE",tag=X,multilingual-rendering=common]
944
948
  .Caption
945
949
  image::spec/examples/rice_images/rice_image1.png[]
946
950
 
@@ -948,7 +952,7 @@ RSpec.describe Asciidoctor::Standoc do
948
952
  output = <<~OUTPUT
949
953
  #{BLANK_HDR}
950
954
  <sections>
951
- <figure id="_"><name>Caption</name>
955
+ <figure id="_" tag='X' multilingual-rendering='common'><name>Caption</name>
952
956
  <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3" title="TITLE" alt="IMAGE" filename="riceimg1.png"/>
953
957
  </figure>
954
958
  </sections>
@@ -1010,18 +1014,62 @@ RSpec.describe Asciidoctor::Standoc do
1010
1014
  INPUT
1011
1015
  expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1012
1016
  .to include '<image src="data:image/png;base64'
1017
+
1018
+ input = <<~INPUT
1019
+ = Document title
1020
+ Author
1021
+ :docfile: test.adoc
1022
+ :nodoc:
1023
+ :novalid:
1024
+ :no-isobib:
1025
+ :data-uri-image: true
1026
+
1027
+ .Split-it-right sample divider
1028
+ image::spec/examples/rice_images/rice_image1.png[]
1029
+ INPUT
1030
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1031
+ .to include '<image src="data:image/png;base64'
1032
+
1033
+ input = <<~INPUT
1034
+ = Document title
1035
+ Author
1036
+ :docfile: test.adoc
1037
+ :nodoc:
1038
+ :novalid:
1039
+ :no-isobib:
1040
+ :data-uri-image: false
1041
+
1042
+ .Split-it-right sample divider
1043
+ image::spec/examples/rice_images/rice_image1.png[]
1044
+ INPUT
1045
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1046
+ .not_to include '<image src="data:image/png;base64'
1047
+
1048
+ input = <<~INPUT
1049
+ = Document title
1050
+ Author
1051
+ :docfile: test.adoc
1052
+ :nodoc:
1053
+ :novalid:
1054
+ :no-isobib:
1055
+
1056
+ .Split-it-right sample divider
1057
+ image::spec/examples/rice_images/rice_image1.png[]
1058
+ INPUT
1059
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1060
+ .to include '<image src="data:image/png;base64'
1013
1061
  end
1014
1062
 
1015
1063
  it "accepts attributes on paragraphs" do
1016
1064
  input = <<~INPUT
1017
1065
  #{ASCIIDOC_BLANK_HDR}
1018
- [align=right,keep-with-next=true,keep-lines-together=true]
1066
+ [align=right,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1019
1067
  This para is right-aligned.
1020
1068
  INPUT
1021
1069
  output = <<~OUTPUT
1022
1070
  #{BLANK_HDR}
1023
1071
  <sections>
1024
- <p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
1072
+ <p align="right" id="_" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>This para is right-aligned.</p>
1025
1073
  </sections>
1026
1074
  </standard-document>
1027
1075
  OUTPUT
@@ -1034,7 +1082,7 @@ RSpec.describe Asciidoctor::Standoc do
1034
1082
  #{ASCIIDOC_BLANK_HDR}
1035
1083
 
1036
1084
  [[ABC]]
1037
- [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true]
1085
+ [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1038
1086
  ____
1039
1087
  Block quotation
1040
1088
  ____
@@ -1042,7 +1090,7 @@ RSpec.describe Asciidoctor::Standoc do
1042
1090
  output = <<~OUTPUT
1043
1091
  #{BLANK_HDR}
1044
1092
  <sections>
1045
- <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
1093
+ <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1046
1094
  <source type="inline" bibitemid="ISO7301" citeas="">
1047
1095
  <localityStack>
1048
1096
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1064,7 +1112,7 @@ RSpec.describe Asciidoctor::Standoc do
1064
1112
 
1065
1113
  [[ABC]]
1066
1114
  .Caption
1067
- [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
1115
+ [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1068
1116
  --
1069
1117
  puts "Hello, world."
1070
1118
  %w{a b c}.each do |x|
@@ -1075,7 +1123,7 @@ RSpec.describe Asciidoctor::Standoc do
1075
1123
  output = <<~OUTPUT
1076
1124
  #{BLANK_HDR}
1077
1125
  <sections>
1078
- <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
1126
+ <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1079
1127
  <name>Caption</name>puts "Hello, world."
1080
1128
  %w{a b c}.each do |x|
1081
1129
  puts x
@@ -1124,6 +1172,8 @@ RSpec.describe Asciidoctor::Standoc do
1124
1172
 
1125
1173
  === Term1
1126
1174
 
1175
+ Definition 0
1176
+
1127
1177
  [.source]
1128
1178
  <<ISO2191,section=1>>
1129
1179
 
@@ -1150,15 +1200,16 @@ RSpec.describe Asciidoctor::Standoc do
1150
1200
  <title>Terms and definitions</title><p id="_">For the purposes of this document,
1151
1201
  the following terms and definitions apply.</p>
1152
1202
  <term id="term-term1">
1153
- <preferred>Term1</preferred>
1154
- <termsource status="identical">
1203
+ <preferred><expression><name>Term1</name></expression></preferred>
1204
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1205
+ <termsource status="identical" type="authoritative">
1155
1206
  <origin bibitemid="ISO2191" type="inline" citeas="">
1156
1207
  <localityStack>
1157
1208
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
1158
1209
  </localityStack>
1159
1210
  </origin>
1160
1211
  </termsource>
1161
- <termsource status="identical">
1212
+ <termsource status="identical" type="authoritative">
1162
1213
  <origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
1163
1214
  <localityStack>
1164
1215
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1167,21 +1218,23 @@ RSpec.describe Asciidoctor::Standoc do
1167
1218
  </termsource>
1168
1219
  </term>
1169
1220
  <term id='term-term2'>
1170
- <preferred>Term2</preferred>
1221
+ <preferred><expression><name>Term2</name></expression></preferred>
1171
1222
  <definition>
1223
+ <verbaldefinition>
1172
1224
  <p id='_'>Definition</p>
1225
+ </verbaldefinition>
1173
1226
  </definition>
1174
- <termsource status='identical'>
1227
+ <termsource status='identical' type="authoritative">
1175
1228
  <origin citeas=''>
1176
1229
  <termref base='IEV' target='xyz'/>
1177
1230
  </origin>
1178
1231
  </termsource>
1179
- <termsource status='identical'>
1232
+ <termsource status='identical' type="authoritative">
1180
1233
  <origin citeas=''>
1181
1234
  <termref base='IEV' target='xyz'/>
1182
1235
  </origin>
1183
1236
  </termsource>
1184
- <termsource status='identical'>
1237
+ <termsource status='identical' type="authoritative">
1185
1238
  <origin citeas=''>
1186
1239
  <termref base='IEV' target='xyz'/>
1187
1240
  </origin>
@@ -1202,6 +1255,8 @@ RSpec.describe Asciidoctor::Standoc do
1202
1255
 
1203
1256
  === Term1
1204
1257
 
1258
+ Definition 0
1259
+
1205
1260
  [.source]
1206
1261
  <<ISO2191,section=1>>, with adjustments
1207
1262
 
@@ -1220,8 +1275,9 @@ RSpec.describe Asciidoctor::Standoc do
1220
1275
  <p id="_">For the purposes of this document,
1221
1276
  the following terms and definitions apply.</p>
1222
1277
  <term id="term-term1">
1223
- <preferred>Term1</preferred>
1224
- <termsource status="modified">
1278
+ <preferred><expression><name>Term1</name></expression></preferred>
1279
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1280
+ <termsource status="modified" type="authoritative">
1225
1281
  <origin bibitemid="ISO2191" type="inline" citeas="">
1226
1282
  <localityStack>
1227
1283
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -1233,11 +1289,11 @@ RSpec.describe Asciidoctor::Standoc do
1233
1289
  </termsource>
1234
1290
  </term>
1235
1291
  <term id='term-term2'>
1236
- <preferred>Term2</preferred>
1237
- <definition>
1292
+ <preferred><expression><name>Term2</name></expression></preferred>
1293
+ <definition><verbaldefinition>
1238
1294
  <p id='_'>Definition</p>
1239
- </definition>
1240
- <termsource status='modified'>
1295
+ </verbaldefinition></definition>
1296
+ <termsource status='modified' type="authoritative">
1241
1297
  <origin citeas=''>
1242
1298
  <termref base='IEV' target='xyz'/>
1243
1299
  </origin>
@@ -1254,10 +1310,82 @@ RSpec.describe Asciidoctor::Standoc do
1254
1310
  .to be_equivalent_to xmlpp(output)
1255
1311
  end
1256
1312
 
1313
+
1314
+ it "processes term source attributes" do
1315
+ input = <<~INPUT
1316
+ #{ASCIIDOC_BLANK_HDR}
1317
+ == Terms and Definitions
1318
+
1319
+ === Term1
1320
+
1321
+ Definition 0
1322
+
1323
+ [.source,status=generalisation]
1324
+ <<ISO2191,section=1>>, with adjustments
1325
+
1326
+ === Term2
1327
+
1328
+ Definition
1329
+
1330
+ [.source,type=lineage]
1331
+ {{<<IEV:xyz>>}}, with adjustments
1332
+ INPUT
1333
+ output = <<~OUTPUT
1334
+ #{BLANK_HDR}
1335
+ <sections>
1336
+ <terms id='_' obligation='normative'>
1337
+ <title>Terms and definitions</title>
1338
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1339
+ <term id='term-term1'>
1340
+ <preferred>
1341
+ <expression>
1342
+ <name>Term1</name>
1343
+ </expression>
1344
+ </preferred>
1345
+ <definition><verbaldefinition><p id='_'>Definition 0</p></verbaldefinition></definition>
1346
+ <termsource status='generalisation' type='authoritative'>
1347
+ <origin bibitemid='ISO2191' type='inline' citeas=''>
1348
+ <localityStack>
1349
+ <locality type='section'>
1350
+ <referenceFrom>1</referenceFrom>
1351
+ </locality>
1352
+ </localityStack>
1353
+ </origin>
1354
+ <modification>
1355
+ <p id='_'>with adjustments</p>
1356
+ </modification>
1357
+ </termsource>
1358
+ </term>
1359
+ <term id='term-term2'>
1360
+ <preferred>
1361
+ <expression>
1362
+ <name>Term2</name>
1363
+ </expression>
1364
+ </preferred>
1365
+ <definition><verbaldefinition>
1366
+ <p id='_'>Definition</p>
1367
+ </verbaldefinition></definition>
1368
+ <termsource status='modified' type='lineage'>
1369
+ <origin citeas=''>
1370
+ <termref base='IEV' target='xyz'/>
1371
+ </origin>
1372
+ <modification>
1373
+ <p id='_'>with adjustments</p>
1374
+ </modification>
1375
+ </termsource>
1376
+ </term>
1377
+ </terms>
1378
+ </sections>
1379
+ </standard-document>
1380
+ OUTPUT
1381
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1382
+ .to be_equivalent_to xmlpp(output)
1383
+ end
1384
+
1257
1385
  it "processes recommendation" do
1258
1386
  input = <<~"INPUT"
1259
1387
  #{ASCIIDOC_BLANK_HDR}
1260
- [.recommendation,label="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
1388
+ [.recommendation,label="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc,tag=X,multilingual-rendering=common]
1261
1389
  ====
1262
1390
  I recommend this
1263
1391
  ====
@@ -1265,7 +1393,7 @@ RSpec.describe Asciidoctor::Standoc do
1265
1393
  output = <<~"OUTPUT"
1266
1394
  #{BLANK_HDR}
1267
1395
  <sections>
1268
- <recommendation id="_" unnumbered="true" type="verification" model="ogc">
1396
+ <recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
1269
1397
  <label>/ogc/recommendation/wfs/2</label>
1270
1398
  <subject>user</subject>
1271
1399
  <subject>developer, implementer</subject>
@@ -1285,7 +1413,7 @@ RSpec.describe Asciidoctor::Standoc do
1285
1413
  input = <<~"INPUT"
1286
1414
  #{ASCIIDOC_BLANK_HDR}
1287
1415
  [[ABC]]
1288
- [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true]
1416
+ [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1289
1417
  .Title
1290
1418
  ====
1291
1419
  I recommend this
@@ -1294,7 +1422,7 @@ RSpec.describe Asciidoctor::Standoc do
1294
1422
  output = <<~OUTPUT
1295
1423
  #{BLANK_HDR}
1296
1424
  <sections>
1297
- <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
1425
+ <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1298
1426
  <title>Title</title>
1299
1427
  <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1300
1428
  <description><p id="_">I recommend this</p></description>
@@ -1312,7 +1440,7 @@ RSpec.describe Asciidoctor::Standoc do
1312
1440
  #{ASCIIDOC_BLANK_HDR}
1313
1441
 
1314
1442
  [[ABC]]
1315
- [.permission]
1443
+ [.permission,tag=X,multilingual-rendering=common]
1316
1444
  ====
1317
1445
  I recommend this
1318
1446
  ====
@@ -1320,7 +1448,7 @@ RSpec.describe Asciidoctor::Standoc do
1320
1448
  output = <<~"OUTPUT"
1321
1449
  #{BLANK_HDR}
1322
1450
  <sections>
1323
- <permission id="ABC">
1451
+ <permission id="ABC" tag='X' multilingual-rendering='common'>
1324
1452
  <description><p id="_">I recommend this</p></description>
1325
1453
  </permission>
1326
1454
  </sections>
@@ -1605,4 +1733,35 @@ RSpec.describe Asciidoctor::Standoc do
1605
1733
  expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1606
1734
  .to be_equivalent_to xmlpp(output)
1607
1735
  end
1736
+
1737
+ it "processes hard breaks" do
1738
+ input = <<~INPUT
1739
+ #{ASCIIDOC_BLANK_HDR}
1740
+
1741
+ [%hardbreaks]
1742
+ One hardbreak
1743
+ Two
1744
+
1745
+ Three hardbreaks +
1746
+ Four
1747
+ INPUT
1748
+ output = <<~OUTPUT
1749
+ #{BLANK_HDR}
1750
+ <sections>
1751
+ <p id='_'>
1752
+ One hardbreak
1753
+ <br/>
1754
+ Two
1755
+ </p>
1756
+ <p id='_'>
1757
+ Three hardbreaks
1758
+ <br/>
1759
+ Four
1760
+ </p>
1761
+ </sections>
1762
+ </standard-document>
1763
+ OUTPUT
1764
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1765
+ .to be_equivalent_to xmlpp(output)
1766
+ end
1608
1767
  end