metanorma-standoc 2.10.1 → 2.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/cleanup_text.rb +23 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72c6ed69fa0ccc28a28c17306eee42d5a79512aac74e88fac810415ebed8744
|
4
|
+
data.tar.gz: 7f965dc03a094785be980450a1c5370de9d43ddbae30c805ca65669911d0dc69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49896c1fd5521c1065a6a789baf7008a312bc1706772aff2b9938621d97185d77f4f8cd24d13c7b50554549e33b1f04c7b3a12364548d2fd6994431b12c967b4
|
7
|
+
data.tar.gz: 95e3c3de4fc714b04ebf54e24d2ae1c4d24cfafd9f9e3fb5795a5be8c5b86b302c6f2025d55eba42634666239faaa4cb863ad307eff14300765e8c096c00cc49
|
@@ -88,6 +88,15 @@ module Metanorma
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
+
# "abc<tag/>", def => "abc",<tag/> def
|
92
|
+
# TODO?
|
93
|
+
def uninterrupt_quotes_around_xml1(xmldoc)
|
94
|
+
xmldoc.xpath("//text()[preceding-sibling::*[1]]").each do |n|
|
95
|
+
uninterrupt_quotes_around_xml_skip(n) and next
|
96
|
+
uninterrupt_quotes_around_xml1(n.previous)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
91
100
|
IGNORE_QUOTES_ELEMENTS =
|
92
101
|
%w(pre tt sourcecode stem asciimath figure bibdata passthrough
|
93
102
|
identifier metanorma-extension).freeze
|
@@ -157,6 +166,20 @@ module Metanorma
|
|
157
166
|
end
|
158
167
|
end
|
159
168
|
|
169
|
+
def dumb2smart_quotesx(xmldoc)
|
170
|
+
# TODO?>
|
171
|
+
prev = ""
|
172
|
+
xmldoc.xpath("//* | //text()").each do |x|
|
173
|
+
x.is_a?(Nokogiri::XML::Node) or next
|
174
|
+
block?(x) and prev = ""
|
175
|
+
empty_tag_with_text_content?(x) and prev = "dummy"
|
176
|
+
x.text? or next
|
177
|
+
ancestor_include?(x, IGNORE_QUOTES_ELEMENTS) and next
|
178
|
+
dumb2smart_quotes1(x, prev)
|
179
|
+
prev = x.text
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
160
183
|
def dumb2smart_quotes1(curr, prev)
|
161
184
|
/[-'"(<>]|\.\.|\dx/.match?(curr.text) or return
|
162
185
|
|
data/metanorma-standoc.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
33
33
|
spec.add_dependency "crass", "~> 1.0.0"
|
34
34
|
spec.add_dependency "iev", "~> 0.3.0"
|
35
|
-
spec.add_dependency "isodoc", "~> 2.12.
|
35
|
+
spec.add_dependency "isodoc", "~> 2.12.4"
|
36
36
|
spec.add_dependency "metanorma", ">= 1.6.0"
|
37
37
|
spec.add_dependency "metanorma-plugin-datastruct", "~> 0.3.0"
|
38
38
|
spec.add_dependency "metanorma-plugin-glossarist", "~> 0.2.0"
|
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.10.
|
4
|
+
version: 2.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.12.
|
75
|
+
version: 2.12.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.12.
|
82
|
+
version: 2.12.4
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: metanorma
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|