-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Add custom replace rule to markdownlint configuration #17988
Conversation
We have to pay attention to two things:
So I think we should be conservative or have a way to skip pages (for the first case). And we should skip code snippets (areas enclosed with 1 or 3 backticks) Finally, like always we must clean MDN first, before adding automation. As this was already cleaned not too long ago, this shouldn't be too difficult. |
This comment was marked as outdated.
This comment was marked as outdated.
Currently developers refer to only |
fcdf906
to
8f3c613
Compare
8f3c613
to
5945053
Compare
5945053
to
13ead1c
Compare
13ead1c
to
0a180cf
Compare
All, I've rebased and updated the lock file. Also added new rules as per our recent experiences. Added new rules to fix
Using this we've merged following PR |
Can you rebase this PR? There are merge conflicts and warnings that I think were fixed elsewhere. |
1d7666f
to
1110670
Compare
Yes. There are two options to solve this:
|
I think we should use HTML escape sequences in these rare cases: see #17988 |
ff9d5e2
to
75d3a3e
Compare
All the lint errors, that were being flagged by this plugin, have been fixed. |
I'm not sure if https://github.com/DavidAnson/markdownlint/blob/main/README.md#optionscustomrules is available in the config without migrating to the the CLI2 https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc. Reason I haven't switched to the CLI2 is the lack of a I really like the quote rules and the URL ones, I'm a little -0 on the elipsis and m-dash ones. |
1f4ea53
to
011aee9
Compare
Preview URLsFlawsNone! 🎉 External URLsURL: No new external URLs (this comment was updated 2022-09-01 06:07:07.801741) |
Actually, we are using https://github.com/igorshubovych/markdownlint-cli project for our linting and not https://github.com/DavidAnson/markdownlint (not directly). And
The PR does work. I've deliberately committed the typos to the PR in deleberate error for testing commit.
ellipsis - we are not adding any rule related to ellipsis in this PR. |
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, but let's not merge this during the weekend as we are not here to deal with unexpected problems.
5ff35ba
to
a0dc272
Compare
There are many unwanted characters that we've been replacing time to time. For example, #16324, #16770 (comment), #17834 (review) are some of the PRs.
Because of some locales or keyboard settings contributors introduce such characters.
We want to handle cases such as:
“
to straight quotes"
curly -> straight apostrophes #16770‘
and’
to straight quote'
--
to m-dash—
-- to m-dash #17833...
to ellipsis…
(en-US/docs
with(/en-US/docs
to avoid broken links fix a broken link #18670 (comment)The PR adds a custom markdownlint rule/plugin markdownlint-rule-search-replace to address such issues.
With the
search-replace
rule in place we can run the linter like this:We can provide plain string or regex pattern to search and replace. So many complex cases can be handled.
Refer the rule documentation for more information.
To see the plugin in action refer #18210.
cc/ @teoli2003 , @nschonni , @caugner