fix(issues): resolve issue end column against its own line - #871
Draft
caugner wants to merge 1 commit into
Draft
Conversation
`DIssue::from_issue` converted both the start and the end byte column to character columns against the start line's content. An issue can span lines, in which case `end_col` is a byte column within `end_line`, so the conversion used the wrong line and could report an end column past the end of that line. Extract the conversion into `char_columns` and resolve `end_line` separately.
Contributor
|
a218c5a was deployed to: https://rari-pr871.review.mdn.allizom.net/ |
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.
Description
Resolve an issue's end column against the line given by
end_lineinstead of the start line, by extracting the byte-to-character conversion intochar_columns.Motivation
Ensure the end column of an issue spanning multiple lines is converted against the line it actually belongs to, instead of pointing past the end of the start line.
Additional details
No change on current content: a full en-US build (1052 issues in 397 files) reports identical flaws before and after. Multi-line issues don't occur in en-US today, but multi-line links exist in translated-content, and macros can span lines (#872).
Related issues and pull requests
Relates to #872.