google_translate_diff 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google_translate_diff/tokenizer.rb +2 -5
- data/lib/google_translate_diff/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d8fec60fb5c755b82e48191d74c53a99eae96d6
|
4
|
+
data.tar.gz: f1adf91843a4ff8379fb253149d5412d991e6f4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1106eef8897b0dfcf2668836a20e9abe1d167b4a9f44dcd18194b2001640c1987bf808717638968470145d3f3dfb0e951c534fd94b8b98f64a5d94214a2fe960
|
7
|
+
data.tar.gz: f5f53c801ab98ce8b8db322c9779d37569b85693ee4337f5358fa6fb35ea3fb9f912beacbd97701ab08651804c330a6740f15dd4ab0d937751709938a17ffc4b
|
@@ -64,17 +64,14 @@ class GoogleTranslateDiff::Tokenizer < ::Ox::Sax
|
|
64
64
|
class << self
|
65
65
|
def tokenize(value)
|
66
66
|
return [] if value.nil?
|
67
|
-
tmp = Ox.default_options
|
68
|
-
Ox.default_options = HTML_OPTIONS
|
69
67
|
tokenizer = new(value).tap do |h|
|
70
|
-
Ox.sax_parse(h, StringIO.new(value))
|
68
|
+
Ox.sax_parse(h, StringIO.new(value), HTML_OPTIONS)
|
71
69
|
h.cut_last_token
|
72
70
|
end
|
73
|
-
Ox.default_options = tmp
|
74
71
|
tokenizer.tokens
|
75
72
|
end
|
76
73
|
end
|
77
74
|
|
78
75
|
SKIP = %i[script style].freeze
|
79
|
-
HTML_OPTIONS = {
|
76
|
+
HTML_OPTIONS = { smart: true, skip: :skip_return }.freeze
|
80
77
|
end
|