metanorma-standoc 2.0.5 → 2.0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 219579e1dcc116cb03bfddaa5d11819180d7e5b8b306f499335a39a61c2e8075
4
- data.tar.gz: 7d8c958d3ae1e834d5e8a93c8ee3c8ebb4040e4dcee899f1bc66c87e538cdad7
3
+ metadata.gz: 0dc54789f419f00172644d6e4a9fe3bbba74e962ff0abd452ef4f2ad4277c695
4
+ data.tar.gz: 0f76a11d0488e02438a625f8b0d050a1ce5199e209af3e5a3eb392834c996c38
5
5
  SHA512:
6
- metadata.gz: a4925a6bbee7f29186d5a98cd90a51c647b4443b383f5b09e714554c1bc12da5f88c7c7143236077d96ea3685f2885c4057f245c687a5404d9f6c77489ea8063
7
- data.tar.gz: 3644084092782115188b9240f0e8dc68e4ef4b2bb663e5e4270214ab861018ec3a3c4bfd082fbb49f9134af62e714acb309fa774d7ebeaac85a4b20444ef5ef9
6
+ metadata.gz: eae38aaec6ee444c7652de6ea7792fb21299ba8cc970ed74441a241810a46a408c90ce01310d5c832a6e212e1a566560d1b38f098c3e15cb507372831a5b3337
7
+ data.tar.gz: ba50432c6fe3a54e2bb77f2b527f2c6b162b7fcd2febbf008cab773658447c0a9f585aa903c3f7eadff43f0cdffedb61844e5c3919216b32e3460feb4f60375a
@@ -174,11 +174,11 @@ module Metanorma
174
174
  def paragraph(node)
175
175
  return termsource(node) if node.role == "source"
176
176
 
177
- ret = noko do |xml|
177
+ noko do |xml|
178
178
  xml.p **para_attrs(node) do |xml_t|
179
179
  xml_t << node.content
180
180
  end
181
- end.join
181
+ end.join("\n")
182
182
  end
183
183
 
184
184
  def quote_attrs(node)
@@ -203,7 +203,7 @@ module Metanorma
203
203
  quote_attribution(node, q)
204
204
  wrap_in_para(node, q)
205
205
  end
206
- end.join
206
+ end.join("\n")
207
207
  end
208
208
 
209
209
  def listing_attrs(node)
@@ -36,7 +36,7 @@ module Metanorma
36
36
  xml.review **sidebar_attrs(node) do |r|
37
37
  wrap_in_para(node, r)
38
38
  end
39
- end
39
+ end.join("\n")
40
40
  end
41
41
 
42
42
  def todo_attrs(node)
@@ -53,7 +53,7 @@ module Metanorma
53
53
  xml.review **todo_attrs(node) do |r|
54
54
  wrap_in_para(node, r)
55
55
  end
56
- end
56
+ end.join("\n")
57
57
  end
58
58
 
59
59
  def termnote(node)
@@ -126,7 +126,7 @@ module Metanorma
126
126
  file = File.join(@localdir,
127
127
  @boilerplateauthority)
128
128
  end
129
- (!file.nil? and File.exists?(file)) or return
129
+ (!file.nil? and File.exist?(file)) or return
130
130
  conv.populate_template(File.read(file, encoding: "UTF-8"), nil)
131
131
  end
132
132
 
@@ -2,7 +2,7 @@ module Metanorma
2
2
  module Standoc
3
3
  module Cleanup
4
4
  def textcleanup(result)
5
- text = result.flatten.map { |l| l.sub(/\s*$/, "") } * "\n"
5
+ text = result.flatten.map { |l| l.sub(/\s*\Z/, "") } * "\n"
6
6
  !@keepasciimath and text = asciimath2mathml(text)
7
7
  text = text.gsub(/\s+<fn /, "<fn ")
8
8
  text.gsub(%r{<passthrough\s+formats="metanorma">([^<]*)
@@ -32,7 +32,7 @@ module Metanorma
32
32
  end
33
33
 
34
34
  def uninterrupt_quotes_around_xml_skip(elem)
35
- !(/^['"]/.match?(elem.text) &&
35
+ !(/\A['"]/.match?(elem.text) &&
36
36
  elem.previous.ancestors("pre, tt, sourcecode, stem, figure, bibdata")
37
37
  .empty? &&
38
38
  ((elem.previous.text.strip.empty? &&
@@ -42,11 +42,11 @@ module Metanorma
42
42
 
43
43
  def uninterrupt_quotes_around_xml1(elem)
44
44
  prev = elem.at(".//preceding::text()[1]") or return
45
- /\S$/.match?(prev.text) or return
45
+ /\S\Z/.match?(prev.text) or return
46
46
  foll = elem.at(".//following::text()[1]")
47
- m = /^(["'][[:punct:]]*)(\s|$)/
47
+ m = /\A(["'][[:punct:]]*)(\s|\Z)/
48
48
  .match(HTMLEntities.new.decode(foll&.text)) or return
49
- foll.content = foll.text.sub(/^(["'][[:punct:]]*)/, "")
49
+ foll.content = foll.text.sub(/\A(["'][[:punct:]]*)/, "")
50
50
  prev.content = "#{prev.text}#{m[1]}"
51
51
  end
52
52
 
@@ -79,8 +79,8 @@ module Metanorma
79
79
  def dumb2smart_quotes1(curr, prev)
80
80
  /[-'"(<>]|\.\.|\dx/.match?(curr.text) or return
81
81
 
82
- /^["']/.match?(curr.text) && prev.match?(/\S$/) and
83
- curr.content = curr.text.sub(/^"/, "”").sub(/"’"/, "‘")
82
+ /\A["']/.match?(curr.text) && prev.match?(/\S\Z/) and
83
+ curr.content = curr.text.sub(/\A"/, "”").sub(/\A'/, "‘")
84
84
  curr.replace(Metanorma::Utils::smartformat(curr.text))
85
85
  end
86
86
 
@@ -64,7 +64,7 @@ module Metanorma
64
64
 
65
65
  def max_td_count(table)
66
66
  max = 0
67
- table.xpath(".//tr").each do |tr|
67
+ table.xpath("./tr").each do |tr|
68
68
  n = tr.xpath("./td | ./th").size
69
69
  max < n and max = n
70
70
  end
@@ -72,8 +72,8 @@ module Metanorma
72
72
  end
73
73
 
74
74
  def maxrowcols_validate(table, maxcols)
75
- cells2d = table.xpath(".//tr").each_with_object([]) { |_r, m| m << {} }
76
- table.xpath(".//tr").each_with_index do |tr, r|
75
+ cells2d = table.xpath("./*/tr").each_with_object([]) { |_r, m| m << {} }
76
+ table.xpath("./*/tr").each_with_index do |tr, r|
77
77
  curr = 0
78
78
  tr.xpath("./td | ./th").each do |td|
79
79
  curr = maxcols_validate1(td, r, curr, cells2d, maxcols)
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.0.5".freeze
22
+ VERSION = "2.0.5.3".freeze
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.5.3
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-03-21 00:00:00.000000000 Z
11
+ date: 2022-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor