mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #486] MD049/50: Incorrect range/fixinfo if identical errors on the same line #400
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Billiam on GitHub (Jan 19, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/486
Example:
The above will generate two errors for inconsistent strong style for the two
__b__elements, but both errors will share the same range and fixinfo, pointing to only the first instance.Obviously markdown-it doesn't provide this information with the token, and that range info comes from
helpers.getRangeAndFixInfoIfFound, which just usesindexOfagainst the markdown line. This works fine as long as the elements don't have identical content like above.Instead, I think
getRangeAndFixInfoIfFoundcould accept an offset or instance number instead of only returning info for the first result.I assume this affects other inline checks but I'm not sure which offhand.
@DavidAnson commented on GitHub (Jan 19, 2022):
Agree, but I expect this is unlikely in practice. And if it does come up, the next iteration will fix that second violation.