forked from innocenat/kindle-epub-fix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (101 loc) · 4.17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Amazon Kindle EPUB Fix</title>
<script src="https://unpkg.com/@zip.js/zip.js@2.6.12/dist/zip.min.js"></script>
<script src="https://unpkg.com/file-saver@2.0.5/dist/FileSaver.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/light.css">
<style>
ul.scroll {
max-height: 10rem;
overflow: auto;
word-break: break-word;
}
</style>
</head>
<body>
<h1>Amazon Kindle EPUB Fix</h1>
<p>
Amazon's Send to Kindle service has support for EPUB files, however, for historical reasons,
it still assumes ISO-8859-1 encoding if no encoding is specified. This creates malformed
formatting errors for special characters.
It is also pretty strict when it comes to EPUB format validation.
</p>
<p>
This tool will try to fix your EPUB to be able to use with Send to Kindle.
It currently tries to fix these problems:
</p>
<ul>
<li>Fix UTF-8 encoding problem by adding UTF-8 declaration if no encoding is specified</li>
<li>Fix hyperlink problem (result in Amazon rejecting the EPUB) when NCX table of content link to <body>
with ID hash.</li>
<li>Detect invalid and/or missing language tag in metadata, and prompt user to select new language.</li>
<li>Remove stray <img> tags with no source field.</li>
</ul>
<p>
<b>Privacy:</b> The book is processed locally in your browser. We do not upload your file anywhere.
</p>
<p>
<b>Warning: </b> This tool come at no warranty. Please still keep your original EPUB.
We do not guarantee that the resulting file will be valid EPUB file, but it should.
</p>
<p>
<b>Useful Tool: </b> <b><a href="https://ktool.io?ref=kindle-epub-fix">KTool.io</a></b> — Send web articles, newsletters & RSS feeds to Kindle
</p>
<h2>Select your EPUB</h2>
<form>
<label for="keepOriginalFilename">Keep original filename</label>
<input id="keepOriginalFilename" type="checkbox">
<input id="file" type="file" accept=".epub" multiple>
<small>Multiple files allowed.</small>
</form>
<div id="main_status" style="display:none;color:blue;margin:1em 0">
Processing...
</div>
<button id="btnDlAll" style="display:none;margin:1em 0">Download all as zip</button>
<div id="output"></div>
<hr style="margin:1em 0">
<details>
<summary>Version History</summary>
<ul>
<li>
<strong>1.3 - Jan 4, 2023</strong><br>
Batch processing<br>
Language detection is now case-insensitive<br>
XML encoding regex is more forgiving
</li>
<li>
<strong>1.2 - September 13, 2022</strong><br>
Detect invalid language tag and prompt user for new language.<br>
Detect stray image tags and remove them.<br>
Fix bug in body ID tag replacement.
</li>
<li>
<strong>1.1.1 - September 10, 2022</strong><br>
User experience improvements.<br>
Add prefix to filenames of EPUBs that were fixed.
</li>
<li>
<strong>1.1 - August 24, 2022</strong><br>
Restructure the code to be able to handle other error types.<br>
Fix cannot detect existing encoding declaration if the declaration is using single quote.<br>
Add new fix for invalid hyperlink to body tag with ID.<br>
Also show the list of what has been fixed.
</li>
<li>
<strong>1.0.1 - August 14, 2022</strong><br>
Fix CRC problem in generated EPUB file caused by ZIP library.
</li>
<li>
<strong>1.0 - July 14, 2022</strong><br>
Initial release.
</li>
</ul>
</details>
<p>Source code is available on <a href="https://github.com/innocenat/kindle-epub-fix" rel="noopener"
target="_blank">GitHub.</a></p>
<script src="script.js"></script>
</body>
</html>