Skip to content

Commit eb6a598

Browse files
committed
fix: kindle support cause minify css/js
1 parent 5ca4371 commit eb6a598

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

epub_browser/processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,8 @@ def create_index_page(self):
10451045
</script>
10461046
</body>
10471047
</html>"""
1048-
index_html = minify_html.minify(index_html, minify_css=True, minify_js=True)
1048+
# kindle 支持,不能压缩 css 和 js
1049+
index_html = minify_html.minify(index_html, minify_css=False, minify_js=False)
10491050
with open(os.path.join(self.web_dir, 'index.html'), 'w', encoding='utf-8') as f:
10501051
f.write(index_html)
10511052

@@ -2864,7 +2865,8 @@ def create_chapter_template(self, content, style_links, chapter_index, chapter_t
28642865
</body>
28652866
</html>
28662867
"""
2867-
chapter_html = minify_html.minify(chapter_html, minify_css=True, minify_js=True)
2868+
# kindle 支持,不能压缩 css 和 js
2869+
chapter_html = minify_html.minify(chapter_html, minify_css=False, minify_js=False)
28682870
return chapter_html
28692871

28702872
def copy_resources(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="epub-browser", # 在PyPI上显示的项目名称
9-
version="1.2.11", # 初始版本号
9+
version="1.2.12", # 初始版本号
1010
author="dfface", # 作者名
1111
author_email="dfface@sina.com", # 作者邮箱
1212
keywords="epub reader html export browser convert calibre-web calibre kindle web server local",

0 commit comments

Comments
 (0)