This commit is contained in:
parent
ce7293824e
commit
10612fefae
@ -549,9 +549,10 @@ class EPUBReader:
|
||||
default_font = Font()
|
||||
error_para.add_word(
|
||||
Word(
|
||||
f"Error loading chapter: {
|
||||
str(e)}",
|
||||
default_font))
|
||||
f"Error loading chapter: {str(e)}",
|
||||
default_font
|
||||
)
|
||||
)
|
||||
chapter.add_block(error_para)
|
||||
# Still add PageBreak even after error
|
||||
chapter.add_block(PageBreak())
|
||||
|
||||
@ -110,8 +110,8 @@ class Font:
|
||||
logger.info(f"Loading bundled font from: {bundled_font_path}")
|
||||
self._font = ImageFont.truetype(bundled_font_path, self._font_size)
|
||||
logger.info(
|
||||
f"Successfully loaded bundled font at size {
|
||||
self._font_size}")
|
||||
f"Successfully loaded bundled font at size {self._font_size}"
|
||||
)
|
||||
else:
|
||||
# Only fall back to PIL's default font if bundled font is not
|
||||
# available
|
||||
|
||||
@ -78,8 +78,8 @@ class TestHTMLFileLoader(unittest.TestCase):
|
||||
self.assertGreater(len(blocks), 0, "Should extract blocks with custom font")
|
||||
|
||||
print(
|
||||
f"Successfully parsed HTML file with custom font, got {
|
||||
len(blocks)} blocks")
|
||||
f"Successfully parsed HTML file with custom font, got {len(blocks)} blocks"
|
||||
)
|
||||
|
||||
def test_load_html_file_content_types(self):
|
||||
"""Test that the loaded HTML file contains expected content types."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user