isodoc-i18n 1.2.4 → 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: d5373a1bd009370c01efe97c54aa373ad71eb520628aabc98207257b84b7a52a
4
- data.tar.gz: 9c97a3e50fa228d20f890aaa16f94ae90efb722ccf9a6e96a62e36f819759745
3
+ metadata.gz: 6e52cf20205df07b323a3139ece748352624ba6db5c859fc75dab26712c6cace
4
+ data.tar.gz: dcc5819254fc72018db7e646d4d2451389f5426f5178875bbd9298d13ea7afdc
5
5
  SHA512:
6
- metadata.gz: e7abebde7c6d4630a4f6f1916d746b5833c3f02c894d5401d9ccba720aae1c699639563066ed493107b6554ae78433c046a1e5ecce496b021cb6613242ef81c4
7
- data.tar.gz: 40d2f238053553382f1ff63eac7d579402e5e296fa18f4f38fe20cae94854ac1d58e658b5d41fe05f039375d6dd4f25cf3bfbedb1c548c699d90dc4a880d7d15
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.4".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,7 +59,7 @@ 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
65
  ZH_CHAR = "(\\p{Han}|\\p{In CJK Symbols And Punctuation}|" \
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.