Fix unwanted br alignment reset
This commit is contained in:
@@ -1104,6 +1104,9 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n
|
|||||||
// Margins/padding are preserved so parent element spacing still accumulates correctly.
|
// Margins/padding are preserved so parent element spacing still accumulates correctly.
|
||||||
if (self->currentTextBlock && self->currentTextBlock->isEmpty()) {
|
if (self->currentTextBlock && self->currentTextBlock->isEmpty()) {
|
||||||
auto style = self->currentTextBlock->getBlockStyle();
|
auto style = self->currentTextBlock->getBlockStyle();
|
||||||
|
// Keep alignment for synthetic empty <br> separator blocks so following inline
|
||||||
|
// text after <br/> inside centered/right-aligned containers preserves alignment.
|
||||||
|
if (!style.fromBrElement) {
|
||||||
style.textAlignDefined = false;
|
style.textAlignDefined = false;
|
||||||
style.alignment = (self->paragraphAlignment == static_cast<uint8_t>(CssTextAlign::None))
|
style.alignment = (self->paragraphAlignment == static_cast<uint8_t>(CssTextAlign::None))
|
||||||
? CssTextAlign::Justify
|
? CssTextAlign::Justify
|
||||||
@@ -1112,6 +1115,7 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ChapterHtmlSlimParser::parseAndBuildPages() {
|
bool ChapterHtmlSlimParser::parseAndBuildPages() {
|
||||||
auto paragraphAlignmentBlockStyle = BlockStyle();
|
auto paragraphAlignmentBlockStyle = BlockStyle();
|
||||||
|
|||||||
Reference in New Issue
Block a user