fixed
This commit is contained in:
@@ -193,10 +193,20 @@ bool Section::createSectionFile(const int fontId, const float lineCompression, c
|
||||
|
||||
SdMan.remove(tmpHtmlPath.c_str());
|
||||
if (!success) {
|
||||
Serial.printf("[%lu] [SCT] Failed to parse XML and build pages\n", millis());
|
||||
file.close();
|
||||
SdMan.remove(filePath.c_str());
|
||||
return false;
|
||||
Serial.printf("[%lu] [SCT] Failed to parse XML, creating placeholder page for chapter\n", millis());
|
||||
// Create a placeholder page for malformed chapters instead of failing entirely
|
||||
// This allows the book to continue loading with chapters that do parse successfully
|
||||
auto placeholderPage = std::unique_ptr<Page>(new Page());
|
||||
// Add placeholder to LUT
|
||||
lut.emplace_back(this->onPageComplete(std::move(placeholderPage)));
|
||||
|
||||
// If we still have no pages, the placeholder creation failed
|
||||
if (pageCount == 0) {
|
||||
Serial.printf("[%lu] [SCT] Failed to create placeholder page\n", millis());
|
||||
file.close();
|
||||
SdMan.remove(filePath.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t lutOffset = file.position();
|
||||
|
||||
Reference in New Issue
Block a user