metanorma-utils 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/log.rb +13 -3
- data/lib/utils/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: 37fbf39c85da8b63e44be8849a9ce41a15522c2e6b805cfb5f9de006701f3110
|
4
|
+
data.tar.gz: 743944d95ebf66f6489df542172126de21bf71e86f9048518bdaa3b9efb9fe0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54239cf1ac5eddd882ea7426124ee609987376942d79ac08d52fb7827dbde060345da8940aafad22fcc01e2db4a1f3047863759e649d7a9529c57aa2eb60b0de
|
7
|
+
data.tar.gz: 4a2d387e3040dcf8f66d88c7f2f131b6bcc1c7fb81acc8d6fa583d46909e5f0dca91de3e8334ece768d6ccb716c7fa9112878aece02fdb54b4e4a9cc1b54a87e
|
data/lib/utils/log.rb
CHANGED
@@ -37,13 +37,23 @@ module Metanorma
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def context(node)
|
40
|
-
|
41
|
-
|
42
|
-
node.respond_to?(:to_xml) and return node.to_xml
|
40
|
+
node.is_a? String and return nil
|
41
|
+
node.respond_to?(:to_xml) and return human_readable_xml(node)
|
43
42
|
node.respond_to?(:to_s) and return node.to_s
|
44
43
|
nil
|
45
44
|
end
|
46
45
|
|
46
|
+
# try to approximate input, at least for maths
|
47
|
+
def human_readable_xml(node)
|
48
|
+
ret = node.dup
|
49
|
+
ret.xpath(".//*[local-name() = 'stem']").each do |s|
|
50
|
+
sub = s.at("./*[local-name() = 'asciimath'] | " \
|
51
|
+
"./*[local-name() = 'latexmath']")
|
52
|
+
sub and s.replace(sub)
|
53
|
+
end
|
54
|
+
ret.to_xml
|
55
|
+
end
|
56
|
+
|
47
57
|
def write(file)
|
48
58
|
File.open(file, "w:UTF-8") do |f|
|
49
59
|
f.puts "#{file} errors"
|
data/lib/utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.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: 2023-
|
11
|
+
date: 2023-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|