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