Repository navigation
Find each tag pair in parse_start_end_tags by position - #6367
Merged
Merged
Conversation
parse_start_end_tags scans from where the last tag ended for the earliest start tag of any pair, then for that pair's end tag after it. Every pair SkipTagsAggregator is given is recognized, and a pair whose start and end tags are the same, such as ("**", "**"), opens and closes.
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
aconchillo
approved these changes
Oct 25, 2026
Contributor
|
Makes sense. LGTM |
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.
SkipTagsAggregatorkeeps text between a start and an end tag in one aggregation, so a sentence boundary inside the tags doesn't split it. It finds the tags withparse_start_end_tags, which counted start and end tags in the text instead of finding where each one is. That missed two cases. This scans the text by position instead.[("<spell>", "</spell>"), ("<card>", "</card>")], a<card>…</card>holding a period was split at it. Now the earliest start tag of any pair opens, and that pair's end tag closes it.("**", "**"), the start and end counts were always equal, so the pair never opened. Now the first**opens it and the next closes it.SkipTagsAggregator, its only caller, uses it. It's now just past an open tag's start, or past the last tag that closed, rather than the end of the text.