Slight adjustments

This commit is contained in:
jpirnay
2026-03-31 21:17:32 +02:00
parent 0ad2ac71c7
commit 913831749e
2 changed files with 2 additions and 5 deletions
@@ -554,10 +554,8 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
} }
} }
// Track ul/ol nesting so li markers can be numbered or bulleted accordingly
if (strcmp(name, "ul") == 0 || strcmp(name, "ol") == 0) { if (strcmp(name, "ul") == 0 || strcmp(name, "ol") == 0) {
self->listStack.push_back({self->depth, strcmp(name, "ol") == 0, 0}); self->listStack.push_back({self->depth, name[0] == 'o', 0});
// fall through to depth increment
} }
const float emSize = static_cast<float>(self->renderer.getFontAscenderSize(self->fontId)); const float emSize = static_cast<float>(self->renderer.getFontAscenderSize(self->fontId));
@@ -592,7 +590,7 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
self->listStack.back().counter += 1; self->listStack.back().counter += 1;
snprintf(marker, sizeof(marker), "%d.", self->listStack.back().counter); snprintf(marker, sizeof(marker), "%d.", self->listStack.back().counter);
} else { } else {
strncpy(marker, "\xe2\x80\xa2", sizeof(marker)); strcpy(marker, "\xe2\x80\xa2");
} }
self->currentTextBlock->addWord(marker, EpdFontFamily::REGULAR); self->currentTextBlock->addWord(marker, EpdFontFamily::REGULAR);
} }
@@ -70,7 +70,6 @@ class ChapterHtmlSlimParser {
int tableRowIndex = 0; int tableRowIndex = 0;
int tableColIndex = 0; int tableColIndex = 0;
// List nesting tracking for ul/ol markers
struct ListEntry { struct ListEntry {
int depth; int depth;
bool isOrdered; bool isOrdered;