epub-parser 0.1.7 → 0.1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +4 -0
- data/lib/epub/parser/version.rb +1 -1
- data/lib/epub/publication/package/manifest.rb +5 -0
- 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: c1bc11e4506d0cb6d2631a97f894db7fd23d0bc6
|
4
|
+
data.tar.gz: bb2243cee7a0113ff16ea513059505471aa2dfad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1dab828812a9f9491af50b3f7c861082f7d4521b5f1a4ae7f4e224e2d6e33abeb574bb00bf989336be0e92b4cedc264aebf2a9cda786f6b978fdeda847c4f4
|
7
|
+
data.tar.gz: 3b64876d7a077daf087d46799a30daa4e58acb6837d04474e713bc4e4e9bf083353c65638c25254cc3aebb8b9fdcc5e318cebd614e0eb29b2504b6c5da58b7c1
|
data/CHANGELOG.markdown
CHANGED
data/README.markdown
CHANGED
@@ -110,6 +110,10 @@ If you find other gems, please tell me or request a pull request.
|
|
110
110
|
RECENT CHANGES
|
111
111
|
--------------
|
112
112
|
|
113
|
+
### 0.1.7.1
|
114
|
+
|
115
|
+
* Don't set encoding when content is not text
|
116
|
+
|
113
117
|
### 0.1.7
|
114
118
|
|
115
119
|
* [Experimental]Add `EPUB::Searcher` module. See {file:Searcher.markdown} for details
|
data/lib/epub/parser/version.rb
CHANGED
@@ -95,6 +95,11 @@ module EPUB
|
|
95
95
|
raw_content = Zip::Archive.open(manifest.package.book.epub_file) {|zip|
|
96
96
|
zip.fopen(entry_name).read
|
97
97
|
}
|
98
|
+
unless media_type.start_with?('text/') or
|
99
|
+
media_type.end_with?('xml') or
|
100
|
+
['application/json', 'application/javascript', 'application/ecmascript', 'application/xml-dtd'].include?(media_type)
|
101
|
+
return raw_content
|
102
|
+
end
|
98
103
|
# CharDet.detect doesn't raise Encoding::CompatibilityError
|
99
104
|
# that is caused when trying compare CharDet's internal
|
100
105
|
# ASCII-8BIT RegExp with a String with other encoding
|