Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

轉檔之後出現書籍不相容閱讀器的問題 #9

Open
6 of 7 tasks
SODAISpod opened this issue Oct 24, 2023 · 0 comments
Open
6 of 7 tasks

轉檔之後出現書籍不相容閱讀器的問題 #9

SODAISpod opened this issue Oct 24, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@SODAISpod
Copy link
Owner

SODAISpod commented Oct 24, 2023

轉檔之後部分閱讀器無法閱讀,且沒有直排效果。

User report:

  1. Calibre 6 可正常顯示直排
  2. Readmoo 的書櫃/文件/上傳:轉檔失敗(但原始檔可正常上傳及閱讀)
  3. Google play 圖書/媒體庫/上傳檔案:處理失敗(但原始檔可正常上傳及閱讀)
  4. KOBO app:匯入檔案後可顯示封面,但開啟檔案時會跳出無法閱讀
  5. 靜讀天下app:文字橫排,引號和括號是直排

Root cause:

  1. 讀取 HTML 時會先使用 HttpUtility.HtmlDecode(source) 把 html 進行 decode,書本內有 & = & ,
    該符號被轉成 「&」導致 reader 誤以為有 ESCAPE character 卻沒有結尾符號「;」
    HttpUtility.HtmlDecode 一開始應該是針對某些檔案全部都用 BOM 儲存所以才需要特殊轉換。
  2. HtmlAgilityPack attribute 會有大小寫變更問題。
  3. HttpAgilityPack 在 toc.html 讀不到某些 tag ,導致後續處理出問題。

Solution:

  • 1. HttpUtility.HtmlDecode 未來改為預設關閉並手動開啟
  • 2. 改為維持原大小寫輸出
  • 3. 目前 <script /> tag 無法讀取,未來需要更換 parser
  • 4. 暫時性解決方案,出問題的頁面先不處理

修改後測試可閱讀

  • Calibre
  • Kobo
  • Play
@SODAISpod SODAISpod added the bug Something isn't working label Oct 24, 2023
@SODAISpod SODAISpod self-assigned this Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant