fix: line break (#525)
## Summary * Fixes #519 * Refactors repeated code into new function: `ChapterHtmlSlimParser::flushPartWordBuffer()` ## Additional Context * The `<br/>` tag is self closing and _in-line_, so the existing logic for closing block tags does not get applied to `<br/>` tags. * This PR adds the _in-line_ logic to: * Flush the word preceding the `<br/>` tag from `partWordBuffer` to `currentTextBlock` before calling `startNewTextBlock` * **New function**: `ChapterHtmlSlimParser::flushPartWordBuffer()` * **Purpose**: Consolidates the logic for flushing `partWordBuffer` to `currentTextBlock` * **Impact**: Simplifies `ChapterHtmlSlimParser::characterData(…)`, `ChapterHtmlSlimParser::startElement(…)`, and `ChapterHtmlSlimParser::endElement(…)` by integrating reused code into single function --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
This commit is contained in:
@@ -39,6 +39,7 @@ class ChapterHtmlSlimParser {
|
||||
bool hyphenationEnabled;
|
||||
|
||||
void startNewTextBlock(TextBlock::Style style);
|
||||
void flushPartWordBuffer();
|
||||
void makePages();
|
||||
// XML callbacks
|
||||
static void XMLCALL startElement(void* userData, const XML_Char* name, const XML_Char** atts);
|
||||
|
||||
Reference in New Issue
Block a user