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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f2fc77a1340a09081ae875e3d2488e75504dd8f96bb0209eb5e881453b79311
4
- data.tar.gz: 3ee3013cd792903ff7bfbd58876751608633df96bd185ef3b07314fde91fd627
3
+ metadata.gz: 33b64b5be38c76e221acfab262018c83cd448fc96ee1423c3d01cba7950a7427
4
+ data.tar.gz: 557d07f77f11df468cdab64b9c49067dde93897a30c18ba026a119705b406fe3
5
5
  SHA512:
6
- metadata.gz: d0b4d37b78694dbf54cab56fde0a7e7d8ee865071992c5dcd1e3d2ef93e5f785d0397224a73082e3884d99ced913ba8be7f0e29359155fc5ee076f478356b562
7
- data.tar.gz: e96945c91aa5d052e84e2656319c6b83800660b11f9edcb3aed0a68146925be06d864bb5e286a91fb57bb9e32a1fc1dc7e4c5899ce3119a9b369c6cc1fd67749
6
+ metadata.gz: 12f71c44d00c21d7e9184513ca4abb4035cdea9b4dc669256b19e8f2f24d3204a5764701eac78966a3714eceb240731fb53fcf8815d1dc05d44337b797d53093
7
+ data.tar.gz: 2c956a89db56bd5afb818ac0078a45f838407b78a39bbba6ef403358f789c3a9dfdba20c65dbb67a57d3ed6c94a3a3098380ae0febbf7045a73d8ba788681d31
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "1.4.9".freeze
3
+ VERSION = "1.5.0".freeze
4
4
  end
5
5
  end
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(/\s*\n$/m, " ").gsub("–", "\u0096")
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.9
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-02-25 00:00:00.000000000 Z
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor