-
Notifications
You must be signed in to change notification settings - Fork 80
fix: handle CR in rules to follow CommonMark spec #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle CR in rules to follow CommonMark spec #493
Conversation
|
For a complete fix, #376 is a prerequisite, as some internal rules are closely tied to self-implemented line break logic. |
…d-cr-to-line-ending-to-follow-spec-strictly
…d-cr-to-line-ending-to-follow-spec-strictly
…d-cr-to-line-ending-to-follow-spec-strictly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule already supports CR line endings, so I only refactored the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
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