metanorma-utils 1.4.9 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/version.rb +1 -1
- data/lib/utils/xml.rb +3 -2
- 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: 33b64b5be38c76e221acfab262018c83cd448fc96ee1423c3d01cba7950a7427
|
4
|
+
data.tar.gz: 557d07f77f11df468cdab64b9c49067dde93897a30c18ba026a119705b406fe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f71c44d00c21d7e9184513ca4abb4035cdea9b4dc669256b19e8f2f24d3204a5764701eac78966a3714eceb240731fb53fcf8815d1dc05d44337b797d53093
|
7
|
+
data.tar.gz: 2c956a89db56bd5afb818ac0078a45f838407b78a39bbba6ef403358f789c3a9dfdba20c65dbb67a57d3ed6c94a3a3098380ae0febbf7045a73d8ba788681d31
|
data/lib/utils/version.rb
CHANGED
data/lib/utils/xml.rb
CHANGED
@@ -41,14 +41,15 @@ module Metanorma
|
|
41
41
|
# block for processing XML document fragments as XHTML,
|
42
42
|
# to allow for HTMLentities
|
43
43
|
# Unescape special chars used in Asciidoctor substitution processing
|
44
|
-
def noko(&block)
|
44
|
+
def noko(script = "Latn", &block)
|
45
45
|
doc = ::Nokogiri::XML.parse(NOKOHEAD)
|
46
46
|
fragment = doc.fragment("")
|
47
47
|
::Nokogiri::XML::Builder.with fragment, &block
|
48
|
+
eoln = %w(Hans Hant Jpan).include?(script) ? "" : " "
|
48
49
|
fragment.to_xml(encoding: "US-ASCII", indent: 0,
|
49
50
|
save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
|
50
51
|
.lines.map do |l|
|
51
|
-
l.gsub(/>\n$/, ">").gsub(/\
|
52
|
+
l.gsub(/>\n$/, ">").gsub(/\n$/m, eoln).gsub("–", "\u0096")
|
52
53
|
.gsub("—", "\u0097").gsub("–", "\u0096")
|
53
54
|
.gsub("—", "\u0097")
|
54
55
|
end
|
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.
|
4
|
+
version: 1.5.0
|
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-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|