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 +4 -4
- data/lib/isodoc/i18n/version.rb +1 -1
- data/lib/isodoc/l10n.rb +7 -2
- metadata +1 -1
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,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
|
-
|
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
|