Merged
Conversation
Flush the word preceding the line break tag to currentTextBlock before calling startNewTextBlock.
Contributor
Author
|
The block of code that gets the |
alpsfordays
added a commit
to ruby-builds/crosspoint-reader
that referenced
this pull request
Jan 26, 2026
Fixes improper <br/> behaviour
alpsfordays
added a commit
to ruby-builds/crosspoint-reader
that referenced
this pull request
Jan 26, 2026
This reverts commit 974b7f2.
Jessica765
pushed a commit
to Jessica765/crosspoint-reader
that referenced
this pull request
Feb 3, 2026
## Summary * Fixes crosspoint-reader#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**_
Unintendedsideeffects
pushed a commit
to Unintendedsideeffects/crosspoint-reader
that referenced
this pull request
Feb 17, 2026
## Summary * Fixes crosspoint-reader#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChapterHtmlSlimParser::flushPartWordBuffer()Additional Context
<br/>tag is self closing and in-line, so the existing logic for closing block tags does not get applied to<br/>tags.<br/>tag frompartWordBuffertocurrentTextBlockbefore callingstartNewTextBlockChapterHtmlSlimParser::flushPartWordBuffer()partWordBuffertocurrentTextBlockChapterHtmlSlimParser::characterData(…),ChapterHtmlSlimParser::startElement(…), andChapterHtmlSlimParser::endElement(…)by integrating reused code into single functionAI 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