metanorma-standoc 2.0.5 → 2.0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/blocks.rb +3 -3
- data/lib/metanorma/standoc/blocks_notes.rb +2 -2
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +1 -1
- data/lib/metanorma/standoc/cleanup_text.rb +7 -7
- data/lib/metanorma/standoc/validate.rb +3 -3
- data/lib/metanorma/standoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dc54789f419f00172644d6e4a9fe3bbba74e962ff0abd452ef4f2ad4277c695
|
4
|
+
data.tar.gz: 0f76a11d0488e02438a625f8b0d050a1ce5199e209af3e5a3eb392834c996c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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
|
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
|
-
!(
|
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
|
45
|
+
/\S\Z/.match?(prev.text) or return
|
46
46
|
foll = elem.at(".//following::text()[1]")
|
47
|
-
m =
|
47
|
+
m = /\A(["'][[:punct:]]*)(\s|\Z)/
|
48
48
|
.match(HTMLEntities.new.decode(foll&.text)) or return
|
49
|
-
foll.content = foll.text.sub(
|
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
|
-
|
83
|
-
curr.content = curr.text.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("
|
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("
|
76
|
-
table.xpath("
|
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)
|
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-
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|