metanorma-iec 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ require "metanorma-iso"
3
3
 
4
4
  module IsoDoc
5
5
  module Iec
6
- class Metadata < IsoDoc::Iso::Metadata
6
+ class Metadata < IsoDoc::Iso::Metadata
7
7
  def docstatus(isoxml, _out)
8
8
  docstatus = isoxml.at(ns("//bibdata/status/stage"))
9
9
  substage = isoxml.at(ns("//bibdata/status/substage"))
@@ -22,7 +22,7 @@ module IsoDoc
22
22
 
23
23
  def doctype(isoxml, _out)
24
24
  super
25
- b = isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
25
+ b = isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
26
26
  b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'en']"))&.text || b
27
27
  b1 and set(:doctype_en, status_print(b1))
28
28
  b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'fr']"))&.text || b
@@ -58,7 +58,7 @@ module IsoDoc
58
58
  <span lang="EN-GB"><span
59
59
  style='mso-element:field-begin'></span><span
60
60
  style='mso-spacerun:yes'>&#xA0;</span>TOC
61
- \\h \\z \\t &quot;TableTitle,tabletitle&quot; <span
61
+ \\h \\z \\t "TableTitle,tabletitle" <span
62
62
  style='mso-element:field-separator'></span></span>
63
63
  TOC
64
64
 
@@ -66,7 +66,7 @@ module IsoDoc
66
66
  <span lang="EN-GB"><span
67
67
  style='mso-element:field-begin'></span><span
68
68
  style='mso-spacerun:yes'>&#xA0;</span>TOC
69
- \\h \\z \\t &quot;FigureTitle,figuretitle&quot; <span
69
+ \\h \\z \\t "FigureTitle,figuretitle" <span
70
70
  style='mso-element:field-separator'></span></span>
71
71
  TOC
72
72
 
@@ -93,7 +93,7 @@ module IsoDoc
93
93
  <span lang="EN-GB"><span
94
94
  style='mso-element:field-begin'></span><span
95
95
  style='mso-spacerun:yes'>&#xA0;</span>TOC
96
- \\o &quot;1-#{level}&quot; \\h \\z \\u <span
96
+ \\o "1-#{level}" \\h \\z \\u <span
97
97
  style='mso-element:field-separator'></span></span>
98
98
  TOC
99
99
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.1.0".freeze
3
+ VERSION = "2.1.1".freeze
4
4
  end
5
5
  end
6
6
 
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ["open.source@ribose.com"]
12
12
 
13
13
  spec.summary = "metanorma-iec lets you write IEC standards "\
14
- "in AsciiDoc."
14
+ "in AsciiDoc."
15
15
  spec.description = <<~DESCRIPTION
16
16
  metanorma-iec lets you write IEC standards in AsciiDoc syntax.
17
17
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
29
29
 
30
- spec.add_dependency "metanorma-iso", "~> 2.1.0"
30
+ spec.add_dependency "metanorma-iso", "~> 2.1.1"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "debug"
@@ -41,4 +41,5 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "sassc", "2.4.0"
42
42
  spec.add_development_dependency "simplecov", "~> 0.15"
43
43
  spec.add_development_dependency "timecop", "~> 0.9"
44
+ # spec.metadata["rubygems_mfa_required"] = "true"
44
45
  end
@@ -87,19 +87,19 @@ INPUT
87
87
  :circulateddate=>"XXX",
88
88
  :confirmeddate=>"XXX",
89
89
  :copieddate=>"XXX",
90
- :createddate=>"2010&ndash;2011",
90
+ :createddate=>"2010&#x2013;2011",
91
91
  :docnumber=>"ISO/PreCD3 17301-1",
92
92
  :docnumeric=>"1730",
93
- :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",
93
+ :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",
94
94
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
95
95
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
96
96
  :docsubtitlepart=>"Riz",
97
- :docsubtitlepartlabel=>"Partie&nbsp;1",
98
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice",
97
+ :docsubtitlepartlabel=>"Partie&#xa0;1",
98
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1: Rice",
99
99
  :doctitleintro=>"Cereals and pulses",
100
100
  :doctitlemain=>"Specifications and test methods",
101
101
  :doctitlepart=>"Rice",
102
- :doctitlepartlabel=>"Part&nbsp;1",
102
+ :doctitlepartlabel=>"Part&#xa0;1",
103
103
  :doctype=>"International Standard",
104
104
  :doctype_display=>"International Standard",
105
105
  :doctype_en=>"International Standard",
@@ -228,16 +228,16 @@ INPUT
228
228
  :copieddate=>"XXX",
229
229
  :createddate=>"XXX",
230
230
  :docnumber=>"ISO/IEC/CD 17301-1-3",
231
- :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",
231
+ :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",
232
232
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
233
233
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
234
234
  :docsubtitlepart=>"Riz",
235
- :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3",
236
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
235
+ :docsubtitlepartlabel=>"Partie&#xa0;1&#x2013;3",
236
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
237
237
  :doctitleintro=>"Cereals and pulses",
238
238
  :doctitlemain=>"Specifications and test methods",
239
239
  :doctitlepart=>"Rice",
240
- :doctitlepartlabel=>"Part&nbsp;1&ndash;3",
240
+ :doctitlepartlabel=>"Part&#xa0;1&#x2013;3",
241
241
  :doctype=>"Technical Report",
242
242
  :doctype_display=>"Technical Report",
243
243
  :doctype_en=>"Technical Report",
@@ -27,7 +27,7 @@ RSpec.describe IsoDoc do
27
27
  .convert("test", input, false)
28
28
  expect(File.exist?("test.html")).to be true
29
29
  html = File.read("test.html", encoding: "UTF-8")
30
- expect(html).to match(%r{<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>})
30
+ expect(html).to include "<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>"
31
31
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
32
32
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
33
33
  end
@@ -57,7 +57,7 @@ RSpec.describe IsoDoc do
57
57
  .convert("test", input, false)
58
58
  expect(File.exist?("test.html")).to be true
59
59
  html = File.read("test.html", encoding: "UTF-8")
60
- expect(html).to match(%r{<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>})
60
+ expect(html).to include "<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>"
61
61
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
62
62
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
63
63
  end
data/spec/spec_helper.rb CHANGED
@@ -37,6 +37,13 @@ def strip_guid(xml)
37
37
  end
38
38
 
39
39
  def xmlpp(xml)
40
+ c = HTMLEntities.new
41
+ xml &&= xml.split(/(&\S+?;)/).map do |n|
42
+ if /^&\S+?;$/.match?(n)
43
+ c.encode(c.decode(n), :hexadecimal)
44
+ else n
45
+ end
46
+ end.join
40
47
  s = ""
41
48
  f = REXML::Formatters::Pretty.new(2)
42
49
  f.compact = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
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-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: 2.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.0
26
+ version: 2.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby-jing
29
29
  requirement: !ruby/object:Gem::Requirement