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 +4 -4
- data/lib/isodoc/i18n/version.rb +1 -1
- data/lib/isodoc/l10n.rb +9 -4
- 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: 6e52cf20205df07b323a3139ece748352624ba6db5c859fc75dab26712c6cace
|
4
|
+
data.tar.gz: dcc5819254fc72018db7e646d4d2451389f5426f5178875bbd9298d13ea7afdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e15949b75cc4b7890a55ab8d23f8174dcd7e5dd6c7221f2fc57822a35a4ecad91a3f82cbf0f32494197d018a8c35043e9691687ab5462fe3beb583c23622315
|
7
|
+
data.tar.gz: a7819bf3cdd153022c0b02b1ba5456b20d83b87b5fa1ae8aefe048be7877af890b2e21ea1dc3355618e2304a23b0740cce38f3bef9c1b0b47a43a343952327b2
|
data/lib/isodoc/i18n/version.rb
CHANGED
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
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2024-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|