Fix discarded CSS text-align

This commit is contained in:
jpirnay committed 2026-03-28 10:39:30 +01:00
1 parent 5b43639f98
commit 69dbfa4b8a
1 file changed
+6 -1
@@ -577,7 +577,12 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
self->startNewTextBlock(self->currentTextBlock->getBlockStyle());
} else {
self->currentCssStyle = cssStyle;
self->startNewTextBlock(userAlignmentBlockStyle);
auto blockStyle = userAlignmentBlockStyle;
if (self->embeddedStyle && cssStyle.hasTextAlign()) {
blockStyle.alignment = cssStyle.textAlign;
blockStyle.textAlignDefined = true;
}
self->startNewTextBlock(blockStyle);
self->updateEffectiveInlineStyle();
if (strcmp(name, "li") == 0) {