fix: handle CR in rules to follow CommonMark spec#493
Merged
Conversation
Member
Author
|
For a complete fix, #376 is a prerequisite, as some internal rules are closely tied to self-implemented line break logic. |
1 task
…d-cr-to-line-ending-to-follow-spec-strictly
1 task
1 task
1 task
…d-cr-to-line-ending-to-follow-spec-strictly
…d-cr-to-line-ending-to-follow-spec-strictly
lumirlumir
commented
Oct 11, 2025
Member
Author
There was a problem hiding this comment.
This rule already supports CR line endings, so I only refactored the code.
Member
Author
There was a problem hiding this comment.
Motivated by #525, I've simplified the regex a bit.
Since imageBang and title can be retrieved directly from the node's information, I've updated the code to access them directly from the nodes.
(This rule already supports CR line endings, so I only refactored the code.)
…d-cr-to-line-ending-to-follow-spec-strictly
Merged
1 task
This was referenced Oct 24, 2025
This was referenced Feb 5, 2026
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.
Prerequisites checklist
What is the purpose of this pull request?
Which language are you using?
CommonMark and GFM.
What did you do?
@eslint/markdownis unable to detect CR line endings in certain rules.What did you expect to happen?
I expect CR line endings to be recognized as valid line endings throughout the Markdown rules.
According to the Markdown(CommonMark) specification, LF, CR, and CRLF can all be used for line endings.
https://spec.commonmark.org/0.31.2/#line-ending
What changes did you make? (Give an overview)
This PR is follow-up to #554 and #555.
In this PR, I've updated the
no-reversed-media-syntaxrule to recognize CR line endings as a valid line break pattern.I've also refactored the
no-htmlandno-reference-like-urlsrules, and added some additional comments to each file.Related Issues
Refs: #554, #555, #491 (comment)
Is there anything you'd like reviewers to focus on?
N/A