metanorma-iso 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -94,25 +94,25 @@ module IsoDoc
94
94
  suffix = @c.encode(part.text, :hexadecimal)
95
95
  p = titlenums[:part]
96
96
  titlenums[:part] && titlenums[:subpart] and
97
- p = "#{titlenums[:part]}–#{titlenums[:subpart]}"
97
+ p = "#{titlenums[:part]}–#{titlenums[:subpart]}"
98
98
  titlenums[:part] and
99
- suffix = "#{part_label(lang)} #{p}: " + suffix
99
+ suffix = "#{part_label(lang)} #{p}: " + suffix
100
100
  suffix
101
101
  end
102
102
 
103
103
  def part_prefix(titlenums, lang)
104
104
  p = titlenums[:part]
105
105
  titlenums[:part] && titlenums[:subpart] and
106
- p = "#{titlenums[:part]}–#{titlenums[:subpart]}"
107
- "#{part_label(lang)} #{p}"
106
+ p = "#{titlenums[:part]}–#{titlenums[:subpart]}"
107
+ "#{part_label(lang)} #{p}"
108
108
  end
109
109
 
110
110
  def amd_prefix(titlenums, lang)
111
- "#{amd_label(lang)} #{titlenums[:amd]}"
111
+ "#{amd_label(lang)} #{titlenums[:amd]}"
112
112
  end
113
113
 
114
114
  def corr_prefix(titlenums, lang)
115
- "#{corr_label(lang)} #{titlenums[:corr]}"
115
+ "#{corr_label(lang)} #{titlenums[:corr]}"
116
116
  end
117
117
 
118
118
  def compose_title(tparts, tnums, lang)
@@ -121,10 +121,10 @@ module IsoDoc
121
121
  main = @c.encode(tparts[:main].text, :hexadecimal)
122
122
  tparts[:intro] &&
123
123
  main = "#{@c.encode(tparts[:intro].text,
124
- :hexadecimal)} — #{main}"
124
+ :hexadecimal)} — #{main}"
125
125
  if tparts[:part]
126
126
  suffix = part_title(tparts[:part], tnums, lang)
127
- main = "#{main} — #{suffix}"
127
+ main = "#{main} — #{suffix}"
128
128
  end
129
129
  main
130
130
  end
@@ -56,7 +56,7 @@ module IsoDoc
56
56
 
57
57
  def eref_localities1_zh(target, type, from, upto, node)
58
58
  ret = " 第#{from}" if from
59
- ret += "–#{upto}" if upto
59
+ ret += "–#{upto}" if upto
60
60
  if node["droploc"] != "true" && !subclause?(target, type, from)
61
61
  ret += eref_locality_populate(type, node)
62
62
  end
@@ -76,7 +76,7 @@ module IsoDoc
76
76
  else ""
77
77
  end
78
78
  ret += " #{from}" if from
79
- ret += "–#{upto}" if upto
79
+ ret += "–#{upto}" if upto
80
80
  ret += ")" if type == "list"
81
81
  l10n(ret)
82
82
  end
@@ -29,7 +29,7 @@ module IsoDoc
29
29
  def figure1(node)
30
30
  lbl = @xrefs.anchor(node["id"], :label, false) or return
31
31
  figname = node.parent.name == "figure" ? "" : "#{@i18n.figure} "
32
- connective = node.parent.name == "figure" ? "  " : " — "
32
+ connective = node.parent.name == "figure" ? "  " : " — "
33
33
  prefix_name(node, connective, l10n("#{figname}#{lbl}"), "name")
34
34
  end
35
35
 
@@ -38,7 +38,7 @@ module IsoDoc
38
38
  lbl = if n.nil? || blank?(n[:label]) then @i18n.example
39
39
  else l10n("#{@i18n.example} #{n[:label]}")
40
40
  end
41
- prefix_name(node, " — ", lbl, "name")
41
+ prefix_name(node, " — ", lbl, "name")
42
42
  end
43
43
 
44
44
  def example_span_label(_node, div, name)
@@ -80,7 +80,7 @@ module IsoDoc
80
80
 
81
81
  def eref_localities1_zh(target, type, from, upto, node)
82
82
  ret = " 第#{from}" if from
83
- ret += "–#{upto}" if upto
83
+ ret += "–#{upto}" if upto
84
84
  node["droploc"] != "true" && !subclause?(target, type, from) and
85
85
  ret += eref_locality_populate(type, node)
86
86
  ret += ")" if type == "list"
@@ -97,7 +97,7 @@ module IsoDoc
97
97
  node["droploc"] != "true" && !subclause?(target, type, from) and
98
98
  ret = eref_locality_populate(type, node)
99
99
  ret += " #{from}" if from
100
- ret += "–#{upto}" if upto
100
+ ret += "–#{upto}" if upto
101
101
  ret += ")" if type == "list"
102
102
  ret = l10n(ret)
103
103
  locality_span_wrap(ret, type)
@@ -9,9 +9,9 @@ module IsoDoc
9
9
  def middle_title_main(out)
10
10
  out.p(**{ class: "zzSTDTitle1" }) do |p|
11
11
  p << @meta.get[:doctitleintro]
12
- p << " &mdash; " if @meta.get[:doctitleintro] && @meta.get[:doctitlemain]
12
+ p << " &#x2014; " if @meta.get[:doctitleintro] && @meta.get[:doctitlemain]
13
13
  p << @meta.get[:doctitlemain]
14
- p << " &mdash; " if @meta.get[:doctitlemain] && @meta.get[:doctitlepart]
14
+ p << " &#x2014; " if @meta.get[:doctitlemain] && @meta.get[:doctitlepart]
15
15
  end
16
16
  a = @meta.get[:doctitlepart] and out.p(**{ class: "zzSTDTitle2" }) do |p|
17
17
  b = @meta.get[:doctitlepartlabel] and p << "#{b}: "
@@ -88,8 +88,8 @@ module IsoDoc
88
88
  <span lang="EN-GB"><span
89
89
  style='mso-element:field-begin'></span><span
90
90
  style='mso-spacerun:yes'>&#xA0;</span>TOC
91
- \\o &quot;1-#{level}&quot; \\h \\z \\t &quot;Heading
92
- 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1&quot; <span
91
+ \\o "1-#{level}" \\h \\z \\t "Heading
92
+ 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1" <span
93
93
  style='mso-element:field-separator'></span></span>
94
94
  TOC
95
95
  end
@@ -31,10 +31,19 @@ module IsoDoc
31
31
  TableFootnote: "Tablefootnote",
32
32
  formula: "Formula",
33
33
  note: "Note",
34
+ example: "Example",
35
+ admonition: "Admonition",
36
+ admonitiontitle: "AdmonitionTitle",
37
+ sourcetitle: "SourceTitle",
38
+ tabletitle: "TableTitle",
39
+ titlepagesbhead: "TablePageSubhead",
34
40
  NormRef: "RefNorm",
35
- biblio: "BiblioEntry",
41
+ Biblio: "BiblioEntry",
36
42
  MsoNormal: "MsoBodyText",
37
43
  FigureTitle: "Figuretitle",
44
+ zzwarning: "zzWarning",
45
+ zzwarninghdr: "zzWarningHdr",
46
+ quoteattribution: "QuoteAttribution",
38
47
  }.freeze
39
48
 
40
49
  def dis_styles(docxml)
@@ -88,8 +97,8 @@ module IsoDoc
88
97
  <<~TOC.freeze
89
98
  <span lang="EN-GB"><span
90
99
  style='mso-element:field-begin'></span><span
91
- style='mso-spacerun:yes'>&#xA0;</span>TOC \\o &quot;2-#{level}&quot; \\h \\z \\t
92
- &quot;Heading 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1;ANNEXN;1;ANNEXZ;1;na2;1;na3;1;na4;1;na5;1;na6;1;Title;1;Base_Heading;1;Box-title;1;Front Head;1;Index Head;1;AMEND Terms Heading;1;AMEND Heading 1 Unnumbered;1&quot;
100
+ style='mso-spacerun:yes'>&#xA0;</span>TOC \\o "2-#{level}" \\h \\z \\t
101
+ "Heading 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1;ANNEXN;1;ANNEXZ;1;na2;1;na3;1;na4;1;na5;1;na6;1;Title;1;Base_Heading;1;Box-title;1;Front Head;1;Index Head;1;AMEND Terms Heading;1;AMEND Heading 1 Unnumbered;1"
93
102
  <span style='mso-element:field-separator'></span></span>
94
103
  TOC
95
104
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.1.0".freeze
3
+ VERSION = "2.1.1".freeze
4
4
  end
5
5
  end
@@ -755,22 +755,22 @@ RSpec.describe IsoDoc do
755
755
  :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
756
756
  :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
757
757
  :docnumeric=>"17301",
758
- :docsubtitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
758
+ :docsubtitle=>"Introduction Fran&#xe7;aise&#xa0;&#x2014; Titre Principal&#xa0;&#x2014; Partie&#xa0;1: Part du Titre",
759
759
  :docsubtitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
760
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
761
- :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
760
+ :docsubtitleamdlabel=>"AMENDMENT&#xa0;1",
761
+ :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&#xa0;2",
762
762
  :docsubtitleintro=>"Introduction Fran&#xe7;aise",
763
763
  :docsubtitlemain=>"Titre Principal",
764
764
  :docsubtitlepart=>"Part du Titre",
765
- :docsubtitlepartlabel=>"Partie&nbsp;1",
766
- :doctitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
765
+ :docsubtitlepartlabel=>"Partie&#xa0;1",
766
+ :doctitle=>"Introduction&#xa0;&#x2014; Main Title&#x2009;&#x2014;&#x2009;Title&#xa0;&#x2014; Part&#xa0;1: Title Part",
767
767
  :doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
768
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
769
- :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
768
+ :doctitleamdlabel=>"AMENDMENT&#xa0;1",
769
+ :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&#xa0;2",
770
770
  :doctitleintro=>"Introduction",
771
771
  :doctitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
772
772
  :doctitlepart=>"Title Part",
773
- :doctitlepartlabel=>"Part&nbsp;1",
773
+ :doctitlepartlabel=>"Part&#xa0;1",
774
774
  :doctype=>"Amendment",
775
775
  :doctype_display=>"Amendment",
776
776
  :docyear=>"2017",
@@ -920,22 +920,22 @@ RSpec.describe IsoDoc do
920
920
  :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
921
921
  :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
922
922
  :docnumeric=>"17301",
923
- :docsubtitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
923
+ :docsubtitle=>"Introduction&#xa0;&#x2014; Main Title&#x2009;&#x2014;&#x2009;Title&#xa0;&#x2014; Part&#xa0;1: Title Part",
924
924
  :docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
925
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
926
- :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
925
+ :docsubtitleamdlabel=>"AMENDMENT&#xa0;1",
926
+ :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&#xa0;2",
927
927
  :docsubtitleintro=>"Introduction",
928
928
  :docsubtitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
929
929
  :docsubtitlepart=>"Title Part",
930
- :docsubtitlepartlabel=>"Part&nbsp;1",
931
- :doctitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
930
+ :docsubtitlepartlabel=>"Part&#xa0;1",
931
+ :doctitle=>"Introduction Fran&#xe7;aise&#xa0;&#x2014; Titre Principal&#xa0;&#x2014; Partie&#xa0;1: Part du Titre",
932
932
  :doctitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
933
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
934
- :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
933
+ :doctitleamdlabel=>"AMENDMENT&#xa0;1",
934
+ :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&#xa0;2",
935
935
  :doctitleintro=>"Introduction Fran&#xe7;aise",
936
936
  :doctitlemain=>"Titre Principal",
937
937
  :doctitlepart=>"Part du Titre",
938
- :doctitlepartlabel=>"Partie&nbsp;1",
938
+ :doctitlepartlabel=>"Partie&#xa0;1",
939
939
  :doctype=>"Amendment",
940
940
  :doctype_display=>"Amendment",
941
941
  :docyear=>"2017",
@@ -97,21 +97,21 @@ RSpec.describe IsoDoc::Iso::Metadata do
97
97
  :circulateddate=>"XXX",
98
98
  :confirmeddate=>"XXX",
99
99
  :copieddate=>"XXX",
100
- :createddate=>"2010&ndash;2011",
100
+ :createddate=>"2010&#x2013;2011",
101
101
  :docnumber=>"ISO/PreCD3 17301-1",
102
102
  :docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
103
103
  :docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
104
104
  :docnumeric=>"1730",
105
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz",
105
+ :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1: Riz",
106
106
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
107
107
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
108
108
  :docsubtitlepart=>"Riz",
109
- :docsubtitlepartlabel=>"Partie&nbsp;1",
110
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice",
109
+ :docsubtitlepartlabel=>"Partie&#xa0;1",
110
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1: Rice",
111
111
  :doctitleintro=>"Cereals and pulses",
112
112
  :doctitlemain=>"Specifications and test methods",
113
113
  :doctitlepart=>"Rice",
114
- :doctitlepartlabel=>"Part&nbsp;1",
114
+ :doctitlepartlabel=>"Part&#xa0;1",
115
115
  :doctype=>"International Standard",
116
116
  :doctype_display=>"International Standard",
117
117
  :docyear=>"2016",
@@ -238,16 +238,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
238
238
  :docnumber=>"ISO/IEC/CD 17301-1-3",
239
239
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
240
240
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
241
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
241
+ :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1&#x2013;3: Riz",
242
242
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
243
243
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
244
244
  :docsubtitlepart=>"Riz",
245
- :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3",
246
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
245
+ :docsubtitlepartlabel=>"Partie&#xa0;1&#x2013;3",
246
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
247
247
  :doctitleintro=>"Cereals and pulses",
248
248
  :doctitlemain=>"Specifications and test methods",
249
249
  :doctitlepart=>"Rice",
250
- :doctitlepartlabel=>"Part&nbsp;1&ndash;3",
250
+ :doctitlepartlabel=>"Part&#xa0;1&#x2013;3",
251
251
  :doctype=>"International Standard",
252
252
  :doctype_display=>"International Standard",
253
253
  :docyear=>"2016",
@@ -374,16 +374,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
374
374
  :docnumber=>"ISO/IEC/CD 17301-1-3",
375
375
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
376
376
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
377
- :docsubtitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
377
+ :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
378
378
  :docsubtitleintro=>"Cereals and pulses",
379
379
  :docsubtitlemain=>"Specifications and test methods",
380
380
  :docsubtitlepart=>"Rice",
381
- :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
382
- :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
381
+ :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
382
+ :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1&#x2013;3: Riz",
383
383
  :doctitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
384
384
  :doctitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
385
385
  :doctitlepart=>"Riz",
386
- :doctitlepartlabel=>"Partie&nbsp;1&ndash;3",
386
+ :doctitlepartlabel=>"Partie&#xa0;1&#x2013;3",
387
387
  :doctype=>"International Standard",
388
388
  :doctype_display=>"Standard International",
389
389
  :docyear=>"2016",
@@ -515,16 +515,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
515
515
  :docnumber=>"ISO/IEC/CD 17301-1-3",
516
516
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
517
517
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
518
- :docsubtitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
518
+ :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
519
519
  :docsubtitleintro=>"Cereals and pulses",
520
520
  :docsubtitlemain=>"Specifications and test methods",
521
521
  :docsubtitlepart=>"Rice",
522
- :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
523
- :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&nbsp;&mdash; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&nbsp;&mdash; Часть&nbsp;1&ndash;3: &#x420;&#x438;&#x441;",
522
+ :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
523
+ :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&#xa0;&#x2014; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&#xa0;&#x2014; Часть&#xa0;1&#x2013;3: &#x420;&#x438;&#x441;",
524
524
  :doctitleintro=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;",
525
525
  :doctitlemain=>"&#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;",
526
526
  :doctitlepart=>"&#x420;&#x438;&#x441;",
527
- :doctitlepartlabel=>"Часть&nbsp;1&ndash;3",
527
+ :doctitlepartlabel=>"Часть&#xa0;1&#x2013;3",
528
528
  :doctype=>"International Standard",
529
529
  :doctype_display=>"International Standard",
530
530
  :docyear=>"2016",
@@ -381,6 +381,7 @@ RSpec.describe IsoDoc do
381
381
  word = File.read("test.doc", encoding: "UTF-8")
382
382
  .sub(/^.*An empty word intro page\./m, "")
383
383
  .sub(%r{</div>.*$}m, "</div>")
384
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")
384
385
 
385
386
  expect(xmlpp("<div>#{word.gsub(/_Toc\d\d+/, '_Toc')}"))
386
387
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
@@ -486,7 +487,6 @@ RSpec.describe IsoDoc do
486
487
  <span style="mso-element:field-end"/>
487
488
  </span>
488
489
  <span lang="EN-GB" xml:lang="EN-GB">
489
- <p class="MsoNormal"> </p>
490
490
  </span>
491
491
  </p>
492
492
  <p class="MsoNormal"> </p>
@@ -1030,7 +1030,8 @@ RSpec.describe IsoDoc do
1030
1030
  '<div class="WordSection2">')
1031
1031
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
1032
1032
 
1033
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
1033
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
1034
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
1034
1035
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
1035
1036
  <div class="WordSection2">An empty word intro page.
1036
1037
  <p class="MsoToc1">
@@ -1110,7 +1111,6 @@ RSpec.describe IsoDoc do
1110
1111
  <span style="mso-element:field-end"/>
1111
1112
  </span>
1112
1113
  <span lang="EN-GB" xml:lang="EN-GB">
1113
- <p class="MsoNormal"> </p>
1114
1114
  </span>
1115
1115
  </p>
1116
1116
  <p class="MsoNormal"> </p>
data/spec/spec_helper.rb CHANGED
@@ -60,6 +60,13 @@ def metadata(hash)
60
60
  end
61
61
 
62
62
  def xmlpp(xml)
63
+ c = HTMLEntities.new
64
+ xml &&= xml.split(/(&\S+?;)/).map do |n|
65
+ if /^&\S+?;$/.match?(n)
66
+ c.encode(c.decode(n), :hexadecimal)
67
+ else n
68
+ end
69
+ end.join
63
70
  s = ""
64
71
  f = REXML::Formatters::Pretty.new(2)
65
72
  f.compact = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc