isodoc-i18n 1.2.3 → 1.2.5

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: d1cb9e9bc5f9e053a31ca971936606b5248577c9b001d3c858d8ecaed201ced8
4
- data.tar.gz: 0ea1ee1c8b6913c3a708d63eee6f6f0af5f6ba171a65b04a7792063bd117a339
3
+ metadata.gz: 6e52cf20205df07b323a3139ece748352624ba6db5c859fc75dab26712c6cace
4
+ data.tar.gz: dcc5819254fc72018db7e646d4d2451389f5426f5178875bbd9298d13ea7afdc
5
5
  SHA512:
6
- metadata.gz: a40fba88473c09f93b3eaf3da323c22c6974e9a50a2a287d4235ba5a757852a38a553765e9fdf6289d0dd97721e4c03660e390d06ece34a6f082b154377c041b
7
- data.tar.gz: c8e0127577dda72be74e84f9e211169b682817f12ba38507d98c81ac5da649b5ae92d3a4d29f1d63b38ec244c4dbc44a23cf95eb0043773d4e6ae3b59309bd1c
6
+ metadata.gz: 8e15949b75cc4b7890a55ab8d23f8174dcd7e5dd6c7221f2fc57822a35a4ecad91a3f82cbf0f32494197d018a8c35043e9691687ab5462fe3beb583c23622315
7
+ data.tar.gz: a7819bf3cdd153022c0b02b1ba5456b20d83b87b5fa1ae8aefe048be7877af890b2e21ea1dc3355618e2304a23b0740cce38f3bef9c1b0b47a43a343952327b2
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
2
  class I18n
3
- VERSION = "1.2.3".freeze
3
+ VERSION = "1.2.5".freeze
4
4
  end
5
5
  end
data/lib/isodoc/l10n.rb CHANGED
@@ -38,7 +38,7 @@ module IsoDoc
38
38
  text = cleanup_entities(n.text, is_xml: false)
39
39
  n.replace(l10_zh1(text, prev, foll, script))
40
40
  end
41
- xml.to_xml(encoding: "UTF-8").gsub(/<b>/, "").gsub("</b>", "")
41
+ to_xml(xml).gsub(/<b>/, "").gsub("</b>", "")
42
42
  .gsub(/<\?[^>]+>/, "")
43
43
  end
44
44
 
@@ -59,11 +59,11 @@ module IsoDoc
59
59
  text = cleanup_entities(n.text, is_xml: false)
60
60
  n.replace(l10n_fr1(text, prev, foll, locale))
61
61
  end
62
- xml.to_xml(encoding: "UTF-8")
62
+ to_xml(xml)
63
63
  end
64
64
 
65
- ZH_CHAR = "\\p{Han}|\\p{In CJK Symbols And Punctuation}|" \
66
- "\\p{In Halfwidth And Fullwidth Forms}".freeze
65
+ ZH_CHAR = "(\\p{Han}|\\p{In CJK Symbols And Punctuation}|" \
66
+ "\\p{In Halfwidth And Fullwidth Forms})".freeze
67
67
 
68
68
  # note: we can't differentiate comma from enumeration comma 、
69
69
  # def l10_zh1(text, _script)
@@ -169,5 +169,10 @@ module IsoDoc
169
169
  /[\u3002.\u3001,\u30fb:;\u2010\u301c\u30a0\u2013!?\u203c\u2047\u2048\u2049]/.match?(text) and return false
170
170
  true
171
171
  end
172
+
173
+ def to_xml(node)
174
+ node&.to_xml(encoding: "UTF-8", indent: 0,
175
+ save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
176
+ end
172
177
  end
173
178
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
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-11-15 00:00:00.000000000 Z
11
+ date: 2024-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities