diff --git a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp index 8aeaa405..5b2fa183 100644 --- a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp +++ b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp @@ -629,7 +629,12 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char* self->startNewTextBlock(brStyle); } 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) {