Skip to content

Fix EPUB2 HTML charset metadata - #1516

Open
nfvelten wants to merge 1 commit into
crocodilestick:mainfrom
nfvelten:fix-epub2-html-charset
Open

Fix EPUB2 HTML charset metadata#1516
nfvelten wants to merge 1 commit into
crocodilestick:mainfrom
nfvelten:fix-epub2-html-charset

Conversation

@nfvelten

@nfvelten nfvelten commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • update existing Content-Type meta charset values regardless of attribute order
  • emit XHTML-compatible http-equiv charset metadata instead of HTML5 meta charset for .html content documents
  • leave no-head HTML untouched instead of prepending metadata before
  • defer fixer lock creation until CLI or EPUBFixer startup so focused imports/tests do not leave stale locks

Fixes #1473.

Tests

  • uv run --no-project --with pytest --with tabulate --with requests python -m pytest tests/unit/test_ingest_processor_startup.py tests/unit/test_kindle_epub_fixer.py
  • uv run --no-project --with ruff ruff check --select I tests/unit/test_kindle_epub_fixer.py
  • uv run --no-project --with ruff ruff check --select SIM115 scripts/kindle_epub_fixer.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] kindle_epub_fixer writes an unclosed <meta charset> into XHTML, corrupting EPUB2 books

1 participant