Add MD050/strong-style (fixes #150).

This commit is contained in:
Sébastien Règne 2021-10-21 06:42:48 +02:00 committed by GitHub
parent 6294ad3ef0
commit ab9e5875a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 255 additions and 19 deletions

View file

@ -85,4 +85,8 @@ markdownLint {MD044}
![](image.jpg) {MD045}
## Heading 10 {MD022}
Strong __with__ underscore style
Strong **with** different style {MD050}
EOF {MD047}

View file

@ -9,7 +9,7 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
__Section 1.1: another section {MD036}__
__Section 1.1: another section {MD036} {MD050}__
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis

View file

@ -6,5 +6,5 @@
[test *test* *test* test](www.test.com)
[test *test* *test* *test* test](www.test.com)
[test **test** test](www.test.com)
[test __test__ test](www.test.com)
[test __test__ test](www.test.com) {MD050}
[this should not raise](www.shouldnotraise.com)

View file

@ -36,7 +36,7 @@ _[This long line is comprised of an emphasized link](https://example.com "This i
**[This long line is comprised of a bolded link](https://example.com "This is the long link's title")**
__[This long line is comprised of a bolded link](https://example.com "This is the long link's title")__
__[This long line is comprised of a bolded link {MD050}](https://example.com "This is the long link's title")__
_**[This long line is comprised of an emphasized and bolded link](https://example.com "This is the long link's title")**_

View file

@ -71,7 +71,13 @@ function lintTestRepo(t, globPatterns, configPath) {
test("https://github.com/eslint/eslint", (t) => {
const rootDir = "./test-repos/eslint-eslint";
const globPatterns = [ join(rootDir, "docs/**/*.md") ];
const globPatterns = [
join(rootDir, "docs/**/*.md"),
"!" + join(
rootDir,
"docs/rules/array-callback-return.md"
)
];
const configPath = join(rootDir, ".markdownlint.yml");
return lintTestRepo(t, globPatterns, configPath);
});
@ -134,7 +140,17 @@ if (existsSync(dotnetDocsDir)) {
const rootDir = dotnetDocsDir;
const globPatterns = [
join(rootDir, "**/*.md"),
"!" + join(rootDir, "samples/**/*.md")
"!" + join(rootDir, "samples/**/*.md"),
"!" + join(
rootDir,
"docs/framework/data/adonet/dataset-datatable-dataview" +
"/security-guidance.md"
),
"!" + join(rootDir, "docs/standard/native-interop/best-practices.md"),
"!" + join(
rootDir,
"docs/standard/serialization/binaryformatter-security-guide.md"
)
];
const configPath = join(rootDir, ".markdownlint.json");
return lintTestRepo(t, globPatterns, configPath);

View file

@ -492,8 +492,9 @@ test.cb("styleAll", (t) => {
"MD042": [ 81 ],
"MD045": [ 85 ],
"MD046": [ 49, 73, 77 ],
"MD047": [ 88 ],
"MD048": [ 77 ]
"MD047": [ 92 ],
"MD048": [ 77 ],
"MD050": [ 90 ]
}
};
// @ts-ignore
@ -535,8 +536,9 @@ test.cb("styleRelaxed", (t) => {
"MD042": [ 81 ],
"MD045": [ 85 ],
"MD046": [ 49, 73, 77 ],
"MD047": [ 88 ],
"MD048": [ 77 ]
"MD047": [ 92 ],
"MD048": [ 77 ],
"MD050": [ 90 ]
}
};
// @ts-ignore
@ -837,7 +839,7 @@ test.cb("customFileSystemAsync", (t) => {
});
});
test.cb("readme", (t) => {
t.plan(115);
t.plan(117);
const tagToRules = {};
rules.forEach(function forRule(rule) {
rule.tags.forEach(function forTag(tag) {
@ -913,7 +915,7 @@ test.cb("readme", (t) => {
});
test.cb("rules", (t) => {
t.plan(336);
t.plan(344);
fs.readFile("doc/Rules.md", "utf8",
(err, contents) => {
t.falsy(err);
@ -1566,7 +1568,7 @@ test.cb("configBadFilePromise", (t) => {
});
test("allBuiltInRulesHaveValidUrl", (t) => {
t.plan(132);
t.plan(135);
rules.forEach(function forRule(rule) {
t.truthy(rule.information);
t.true(Object.getPrototypeOf(rule.information) === URL.prototype);

View file

@ -8,10 +8,10 @@ This paragraph *nests both _kinds_ of emphasis* marker.
This paragraph *nests both __kinds__ of emphasis* marker.
This paragraph **nests both __kinds__ of emphasis** marker.
This paragraph **nests both __kinds__ of emphasis** marker. {MD050}
This paragraph _nests both *kinds* of emphasis_ marker.
This paragraph _nests both **kinds** of emphasis_ marker.
This paragraph _nests both **kinds** of emphasis_ marker. {MD050}
This paragraph __nests both **kinds** of emphasis__ marker.
This paragraph __nests both **kinds** of emphasis__ marker. {MD050}

View file

@ -1,5 +1,7 @@
# Heading
<!-- markdownlint-disable-file strong-style -->
Line with *Normal emphasis*
Line with **Normal strong**

View file

@ -0,0 +1,6 @@
{
"default": true,
"MD050": {
"style": "asterisk"
}
}

View file

@ -0,0 +1,5 @@
# Strong style asterisk
This is **fine**
This is __not__ {MD050}

View file

@ -0,0 +1,6 @@
{
"default": true,
"MD050": {
"style": "underscore"
}
}

View file

@ -0,0 +1,5 @@
# Strong style underscore
This is __fine__
This is **not** {MD050}