Poor mans indicator for sup / sub

This commit is contained in:
jpirnay
2026-05-15 11:42:09 +02:00
parent 27e538aa5a
commit 295d756746
@@ -1163,6 +1163,17 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
}
self->inlineStyleStack.push_back(entry);
self->updateEffectiveInlineStyle();
} else if (strcmp(name, "sup") == 0 || strcmp(name, "sub") == 0) {
if (self->partWordBufferIndex > 0) {
if (!self->flushPartWordBuffer()) return;
self->nextWordContinues = true;
}
const char* prefix = (strcmp(name, "sup") == 0) ? "^" : "_";
self->currentTextBlock->addWord(prefix, EpdFontFamily::REGULAR, false, true);
self->nextWordContinues = true;
StyleStackEntry entry;
entry.depth = self->depth;
self->inlineStyleStack.push_back(entry);
} else if (strcmp(name, "span") == 0 || !isHeaderOrBlock(name)) {
// Handle span and other inline elements for CSS styling
if (cssStyle.hasFontWeight() || cssStyle.hasFontStyle() || cssStyle.hasTextDecoration()) {