mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update new rule MD059/descriptive-link-text for project-level consistency.
This commit is contained in:
parent
b8374ec5d2
commit
571c2353ea
23 changed files with 466 additions and 383 deletions
|
@ -1,16 +1,19 @@
|
||||||
This rule is triggered when a link is set with generic text like
|
This rule is triggered when a link has generic text like `[click here](...)` or
|
||||||
"Click here", "here", or "learn more", giving it a generic accessible name.
|
`[link](...)`.
|
||||||
|
|
||||||
Rationale: Screen reader users may navigate through a list of links
|
Link text should be descriptive and communicate the purpose of the link (e.g.,
|
||||||
to quickly find content on a page. When the link name is something ambiguous
|
`[Download the budget document](...)` or `[CommonMark Specification](...)`).
|
||||||
like "Learn more", there isn't sufficient context to help the user determine
|
This is especially important for screen readers which sometimes present links
|
||||||
whether to follow the link.
|
without context.
|
||||||
|
|
||||||
Link names should be descriptive and describe the purpose of the link, like:
|
By default, this rule prohibits a small number of common English words/phrases.
|
||||||
`[Download the budget document]`, `[About markdownlint]`,`[View registration]`,
|
To customize that list of words/phrases, set the `prohibited_texts` parameter to
|
||||||
etc.
|
an `Array` of `string`s.
|
||||||
|
|
||||||
To override the default list and configure your own list of banned accessible
|
Note: For languages other than English, use the `prohibited_texts` parameter to
|
||||||
names, set `link_texts` in the config.
|
customize the list for that language. It is *not* a goal for this rule to have
|
||||||
|
translations for every language.
|
||||||
|
|
||||||
Note: This rule checks Markdown-style links and ignores HTML-style links.
|
Note: This rule checks Markdown links; HTML links are ignored.
|
||||||
|
|
||||||
|
More information: <https://webaim.org/techniques/hypertext/>
|
||||||
|
|
30
doc/Rules.md
30
doc/Rules.md
|
@ -2548,24 +2548,28 @@ Aliases: `descriptive-link-text`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
- `link_texts`: List of restricted link texts (`string[]`, default `[]`)
|
- `prohibited_texts`: Prohibited link texts (`string[]`, default `["click
|
||||||
|
here","here","link","more"]`)
|
||||||
|
|
||||||
This rule is triggered when a link is set with generic text like
|
This rule is triggered when a link has generic text like `[click here](...)` or
|
||||||
"Click here", "here", or "learn more", giving it a generic accessible name.
|
`[link](...)`.
|
||||||
|
|
||||||
Rationale: Screen reader users may navigate through a list of links
|
Link text should be descriptive and communicate the purpose of the link (e.g.,
|
||||||
to quickly find content on a page. When the link name is something ambiguous
|
`[Download the budget document](...)` or `[CommonMark Specification](...)`).
|
||||||
like "Learn more", there isn't sufficient context to help the user determine
|
This is especially important for screen readers which sometimes present links
|
||||||
whether to follow the link.
|
without context.
|
||||||
|
|
||||||
Link names should be descriptive and describe the purpose of the link, like:
|
By default, this rule prohibits a small number of common English words/phrases.
|
||||||
`[Download the budget document]`, `[About markdownlint]`,`[View registration]`,
|
To customize that list of words/phrases, set the `prohibited_texts` parameter to
|
||||||
etc.
|
an `Array` of `string`s.
|
||||||
|
|
||||||
To override the default list and configure your own list of banned accessible
|
Note: For languages other than English, use the `prohibited_texts` parameter to
|
||||||
names, set `link_texts` in the config.
|
customize the list for that language. It is *not* a goal for this rule to have
|
||||||
|
translations for every language.
|
||||||
|
|
||||||
Note: This rule checks Markdown-style links and ignores HTML-style links.
|
Note: This rule checks Markdown links; HTML links are ignored.
|
||||||
|
|
||||||
|
More information: <https://webaim.org/techniques/hypertext/>
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"no-inline-html": {
|
"no-inline-html": {
|
||||||
|
|
30
doc/md059.md
30
doc/md059.md
|
@ -6,21 +6,25 @@ Aliases: `descriptive-link-text`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
- `link_texts`: List of restricted link texts (`string[]`, default `[]`)
|
- `prohibited_texts`: Prohibited link texts (`string[]`, default `["click
|
||||||
|
here","here","link","more"]`)
|
||||||
|
|
||||||
This rule is triggered when a link is set with generic text like
|
This rule is triggered when a link has generic text like `[click here](...)` or
|
||||||
"Click here", "here", or "learn more", giving it a generic accessible name.
|
`[link](...)`.
|
||||||
|
|
||||||
Rationale: Screen reader users may navigate through a list of links
|
Link text should be descriptive and communicate the purpose of the link (e.g.,
|
||||||
to quickly find content on a page. When the link name is something ambiguous
|
`[Download the budget document](...)` or `[CommonMark Specification](...)`).
|
||||||
like "Learn more", there isn't sufficient context to help the user determine
|
This is especially important for screen readers which sometimes present links
|
||||||
whether to follow the link.
|
without context.
|
||||||
|
|
||||||
Link names should be descriptive and describe the purpose of the link, like:
|
By default, this rule prohibits a small number of common English words/phrases.
|
||||||
`[Download the budget document]`, `[About markdownlint]`,`[View registration]`,
|
To customize that list of words/phrases, set the `prohibited_texts` parameter to
|
||||||
etc.
|
an `Array` of `string`s.
|
||||||
|
|
||||||
To override the default list and configure your own list of banned accessible
|
Note: For languages other than English, use the `prohibited_texts` parameter to
|
||||||
names, set `link_texts` in the config.
|
customize the list for that language. It is *not* a goal for this rule to have
|
||||||
|
translations for every language.
|
||||||
|
|
||||||
Note: This rule checks Markdown-style links and ignores HTML-style links.
|
Note: This rule checks Markdown links; HTML links are ignored.
|
||||||
|
|
||||||
|
More information: <https://webaim.org/techniques/hypertext/>
|
||||||
|
|
|
@ -313,7 +313,7 @@ module.exports.addErrorDetailIf = addErrorDetailIf;
|
||||||
*/
|
*/
|
||||||
function addErrorContext(
|
function addErrorContext(
|
||||||
onError, lineNumber, context, start, end, range, fixInfo) {
|
onError, lineNumber, context, start, end, range, fixInfo) {
|
||||||
context = ellipsify(context, start, end);
|
context = ellipsify(context.replace(newLineRe, "\n"), start, end);
|
||||||
addError(onError, lineNumber, undefined, context, range, fixInfo);
|
addError(onError, lineNumber, undefined, context, range, fixInfo);
|
||||||
}
|
}
|
||||||
module.exports.addErrorContext = addErrorContext;
|
module.exports.addErrorContext = addErrorContext;
|
||||||
|
|
8
lib/configuration-strict.d.ts
vendored
8
lib/configuration-strict.d.ts
vendored
|
@ -1107,9 +1107,9 @@ export interface ConfigurationStrict {
|
||||||
| boolean
|
| boolean
|
||||||
| {
|
| {
|
||||||
/**
|
/**
|
||||||
* List of restricted link texts
|
* Prohibited link texts
|
||||||
*/
|
*/
|
||||||
link_texts?: string[];
|
prohibited_texts?: string[];
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
* MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
||||||
|
@ -1118,9 +1118,9 @@ export interface ConfigurationStrict {
|
||||||
| boolean
|
| boolean
|
||||||
| {
|
| {
|
||||||
/**
|
/**
|
||||||
* List of restricted link texts
|
* Prohibited link texts
|
||||||
*/
|
*/
|
||||||
link_texts?: string[];
|
prohibited_texts?: string[];
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
import { addErrorContext, newLineRe } from "../helpers/helpers.cjs";
|
import { addErrorContext } from "../helpers/helpers.cjs";
|
||||||
import { getDescendantsByType } from "../helpers/micromark-helpers.cjs";
|
import { getDescendantsByType } from "../helpers/micromark-helpers.cjs";
|
||||||
import { filterByTypesCached } from "./cache.mjs";
|
import { filterByTypesCached } from "./cache.mjs";
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ export default {
|
||||||
const endSpaces = endCount > 0;
|
const endSpaces = endCount > 0;
|
||||||
// Check if safe to remove 1-space padding
|
// Check if safe to remove 1-space padding
|
||||||
const removePadding = startSpaces && endSpaces && startPadding && endPadding && !startBacktick && !endBacktick;
|
const removePadding = startSpaces && endSpaces && startPadding && endPadding && !startBacktick && !endBacktick;
|
||||||
const context = codeText.text.replace(newLineRe, "\n");
|
const context = codeText.text;
|
||||||
// If extra space at start, report violation
|
// If extra space at start, report violation
|
||||||
if (startSpaces) {
|
if (startSpaces) {
|
||||||
const startColumn = (removePadding ? startPadding : startData).startColumn;
|
const startColumn = (removePadding ? startPadding : startData).startColumn;
|
||||||
|
|
|
@ -1,28 +1,33 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
import { addErrorContext } from "../helpers/helpers.cjs";
|
import { addErrorContext } from "../helpers/helpers.cjs";
|
||||||
|
import { getDescendantsByType } from "../helpers/micromark-helpers.cjs";
|
||||||
import { filterByTypesCached } from "./cache.mjs";
|
import { filterByTypesCached } from "./cache.mjs";
|
||||||
|
|
||||||
const defaultBannedText = [
|
/** @typedef {import("markdownlint").MicromarkTokenType} MicromarkTokenType */
|
||||||
|
/** @type {Set<MicromarkTokenType>} */
|
||||||
|
const allowedChildrenTypes = new Set([
|
||||||
|
"codeText",
|
||||||
|
"htmlText"
|
||||||
|
]);
|
||||||
|
const defaultProhibitedTexts = [
|
||||||
"click here",
|
"click here",
|
||||||
"here",
|
"here",
|
||||||
"learn more",
|
|
||||||
"link",
|
"link",
|
||||||
"more",
|
"more"
|
||||||
"read more"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalizes a string and removes extra whitespaces and punctuations.
|
* Normalizes a string by removing extra whitespaces and punctuation.
|
||||||
*
|
*
|
||||||
* @param {string} text String to transform.
|
* @param {string} str String to normalize.
|
||||||
* @returns {string} Normalized string with no punctuations or extra whitespaces.
|
* @returns {string} Normalized string.
|
||||||
*/
|
*/
|
||||||
function normalizeText(text) {
|
function normalize(str) {
|
||||||
return text
|
return str
|
||||||
.toLowerCase()
|
.replace(/[\W_]+/g, " ")
|
||||||
.replace(/\W+/g, " ")
|
|
||||||
.replace(/\s+/g, " ")
|
.replace(/\s+/g, " ")
|
||||||
|
.toLowerCase()
|
||||||
.trim();
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,29 +35,35 @@ function normalizeText(text) {
|
||||||
export default {
|
export default {
|
||||||
"names": [ "MD059", "descriptive-link-text" ],
|
"names": [ "MD059", "descriptive-link-text" ],
|
||||||
"description": "Link text should be descriptive",
|
"description": "Link text should be descriptive",
|
||||||
"tags": [ "links", "accessibility" ],
|
"tags": [ "accessibility", "links" ],
|
||||||
"parser": "micromark",
|
"parser": "micromark",
|
||||||
"function": function MD059(params, onError) {
|
"function": function MD059(params, onError) {
|
||||||
const bannedNames = new Set(params.config.link_texts || defaultBannedText);
|
const prohibitedTexts = new Set(
|
||||||
const labels = filterByTypesCached([ "label" ])
|
(params.config.prohibited_texts || defaultProhibitedTexts).map(normalize)
|
||||||
.filter((label) => label.parent?.type === "link");
|
);
|
||||||
|
if (prohibitedTexts.size > 0) {
|
||||||
for (const label of labels) {
|
const links = filterByTypesCached([ "link" ]);
|
||||||
const labelTexts = label.children.filter((child) => child.type === "labelText");
|
for (const link of links) {
|
||||||
for (const labelText of labelTexts) {
|
const labelTexts = getDescendantsByType(link, [ "label", "labelText" ]);
|
||||||
const { text } = label;
|
for (const labelText of labelTexts) {
|
||||||
if (bannedNames.has(normalizeText(text))) {
|
const { children, endColumn, endLine, parent, startColumn, startLine, text } = labelText;
|
||||||
const range = labelText.startLine === labelText.endLine ?
|
if (
|
||||||
[ labelText.startColumn, text.length ] :
|
!children.some((child) => allowedChildrenTypes.has(child.type)) &&
|
||||||
undefined;
|
prohibitedTexts.has(normalize(text))
|
||||||
addErrorContext(
|
) {
|
||||||
onError,
|
const range = (startLine === endLine) ?
|
||||||
labelText.startLine,
|
[ startColumn, endColumn - startColumn ] :
|
||||||
text,
|
undefined;
|
||||||
undefined,
|
addErrorContext(
|
||||||
undefined,
|
onError,
|
||||||
range
|
startLine,
|
||||||
);
|
// @ts-ignore
|
||||||
|
parent.text,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
range
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,12 @@
|
||||||
|
|
||||||
// MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
// MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
||||||
"MD059": {
|
"MD059": {
|
||||||
// List of restricted link texts
|
// Prohibited link texts
|
||||||
"link_texts": []
|
"prohibited_texts": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -278,5 +278,9 @@ MD058: true
|
||||||
|
|
||||||
# MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
# MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md059.md
|
||||||
MD059:
|
MD059:
|
||||||
# List of restricted link texts
|
# Prohibited link texts
|
||||||
link_texts: []
|
prohibited_texts:
|
||||||
|
- "click here"
|
||||||
|
- "here"
|
||||||
|
- "link"
|
||||||
|
- "more"
|
||||||
|
|
|
@ -558,13 +558,18 @@ for (const rule of rules) {
|
||||||
break;
|
break;
|
||||||
case "MD059":
|
case "MD059":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
"link_texts": {
|
"prohibited_texts": {
|
||||||
"description": "List of restricted link texts",
|
"description": "Prohibited link texts",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1724,13 +1724,18 @@
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"link_texts": {
|
"prohibited_texts": {
|
||||||
"description": "List of restricted link texts",
|
"description": "Prohibited link texts",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1743,13 +1748,18 @@
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"link_texts": {
|
"prohibited_texts": {
|
||||||
"description": "List of restricted link texts",
|
"description": "Prohibited link texts",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -1724,13 +1724,18 @@
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"link_texts": {
|
"prohibited_texts": {
|
||||||
"description": "List of restricted link texts",
|
"description": "Prohibited link texts",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1743,13 +1748,18 @@
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"link_texts": {
|
"prohibited_texts": {
|
||||||
"description": "List of restricted link texts",
|
"description": "Prohibited link texts",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": [
|
||||||
|
"click here",
|
||||||
|
"here",
|
||||||
|
"link",
|
||||||
|
"more"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -1,35 +1,13 @@
|
||||||
# Descriptive link text empty config
|
# Descriptive Link Text Empty Config
|
||||||
|
|
||||||
[Learn about Javascript](https://example.com/javascript/about)
|
|
||||||
|
|
||||||
[About Javascript](https://example.com/file.txt)
|
|
||||||
|
|
||||||
Learn about [our mission](https://example.com/mission).
|
|
||||||
|
|
||||||
Go [here](https://example.com/descriptive-links)
|
|
||||||
|
|
||||||
[Learn more](https://example.com/images/about) about us.
|
[Learn more](https://example.com/images/about) about us.
|
||||||
|
|
||||||
[Click here](https://example.com/dir/file.txt).
|
[Click here](https://example.com/dir/file.txt).
|
||||||
|
|
||||||
[read more](https://example.com/guide).
|
Go to this [link](https://example.com/second).
|
||||||
|
|
||||||
To get more support, go [here!](https://example.com/contact).
|
|
||||||
|
|
||||||
Learn [more.](https://example.com/contact).
|
|
||||||
|
|
||||||
To learn about our company, [click here!!!!](https://example.com/about).
|
|
||||||
|
|
||||||
[click-here!!!!](https://example.com/first).
|
|
||||||
|
|
||||||
Go to this [link]((https://example.com/second)).
|
|
||||||
|
|
||||||
[link][url]
|
|
||||||
|
|
||||||
[url]: https://example.com
|
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"descriptive-link-text": {
|
"descriptive-link-text": {
|
||||||
"link_texts": []
|
"prohibited_texts": []
|
||||||
}
|
}
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Descriptive link text override
|
# Descriptive Link Text Override
|
||||||
|
|
||||||
[Go here](https://example.com/javascript/about) {MD059}
|
[Go here](https://example.com/javascript/about) {MD059}
|
||||||
|
|
||||||
|
@ -18,6 +18,6 @@ If you need additional guidance, read [this](https://example.com/links). {MD059}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"descriptive-link-text": {
|
"descriptive-link-text": {
|
||||||
"link_texts": ["go here", "this"]
|
"prohibited_texts": [ "go here", "THIS" ]
|
||||||
}
|
}
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Descriptive link text
|
# Descriptive Link Text
|
||||||
|
|
||||||
[Learn about Javascript](https://example.com/javascript/about)
|
[Learn about Javascript](https://example.com/javascript/about)
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ Learn about [our mission](https://example.com/mission).
|
||||||
|
|
||||||
Go [here](https://example.com/descriptive-links) {MD059}
|
Go [here](https://example.com/descriptive-links) {MD059}
|
||||||
|
|
||||||
[Learn more](https://example.com/images/about) about us. {MD059}
|
[Learn more](https://example.com/images/about) about us.
|
||||||
|
|
||||||
[Click here](https://example.com/dir/file.txt). {MD059}
|
[Click here](https://example.com/dir/file.txt). {MD059}
|
||||||
|
|
||||||
[read more](https://example.com/guide). {MD059}
|
[Read more](https://example.com/guide).
|
||||||
|
|
||||||
To get more support, go [here!](https://example.com/contact). {MD059}
|
To get more support, go [here!](https://example.com/contact). {MD059}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ To learn more, [click here!!!!](https://example.com/about). {MD059}
|
||||||
|
|
||||||
[click-here!!!!](https://example.com/first). {MD059}
|
[click-here!!!!](https://example.com/first). {MD059}
|
||||||
|
|
||||||
Go to this [link]((https://example.com/second)). {MD059}
|
Go to this [link](https://example.com/second). {MD059}
|
||||||
|
|
||||||
[link][Example URL] {MD059}
|
[link][Example URL] {MD059}
|
||||||
|
|
||||||
|
@ -30,3 +30,10 @@ Go to this [link]((https://example.com/second)). {MD059}
|
||||||
|
|
||||||
{MD059} [click
|
{MD059} [click
|
||||||
here](https://example.com)
|
here](https://example.com)
|
||||||
|
|
||||||
|
[link](destination) {MD059}
|
||||||
|
[*link*](destination) {MD059}
|
||||||
|
[_link_](destination) {MD049} {MD059}
|
||||||
|
[~~link~~](destination) {MD059}
|
||||||
|
[`link`](destination)
|
||||||
|
[<link>](destination) {MD033}
|
||||||
|
|
|
@ -907,7 +907,7 @@ test("readme", async(t) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
||||||
t.plan(187);
|
t.plan(186);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const ajv = new Ajv(ajvOptions);
|
const ajv = new Ajv(ajvOptions);
|
||||||
const validateSchemaStrict = ajv.compile(configSchemaStrict);
|
const validateSchemaStrict = ajv.compile(configSchemaStrict);
|
||||||
|
|
|
@ -8,12 +8,10 @@ Generated by [AVA](https://avajs.dev).
|
||||||
|
|
||||||
> Expected linting violations
|
> Expected linting violations
|
||||||
|
|
||||||
`test-repos/mdn-content/files/en-us/glossary/media_query/index.md: 11: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
`test-repos/mdn-content/files/en-us/learn_web_development/core/css_layout/fundamental_layout_comprehension/index.md: 15: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/core/css_layout/fundamental_layout_comprehension/index.md: 15: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/core/scripting/functions/index.md: 90: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/core/scripting/functions/index.md: 90: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/core/structuring_content/creating_links/index.md: 255: MD059/descriptive-link-text Link text should be descriptive [Context: "[Click here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/core/structuring_content/creating_links/index.md: 255: MD059/descriptive-link-text Link text should be descriptive [Context: "[Click here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/core/styling_basics/box_model/index.md: 293: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/core/styling_basics/box_model/index.md: 293: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/extensions/performance/css/index.md: 174: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/extensions/performance/multimedia/index.md: 105: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/extensions/performance/multimedia/index.md: 105: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/extensions/server-side/django/development_environment/index.md: 225: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/extensions/server-side/django/development_environment/index.md: 225: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/learn_web_development/extensions/server-side/django/development_environment/index.md: 464: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/learn_web_development/extensions/server-side/django/development_environment/index.md: 464: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
|
@ -33,38 +31,17 @@ Generated by [AVA](https://avajs.dev).
|
||||||
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/29/index.md: 29: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/29/index.md: 29: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/3/updating_extensions/index.md: 162: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/3/updating_extensions/index.md: 162: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/44/index.md: 218: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/mozilla/firefox/releases/44/index.md: 218: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/aria_techniques/index.md: 18: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/attributes/aria-disabled/index.md: 115: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/attributes/aria-expanded/index.md: 99: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/attributes/aria-haspopup/index.md: 65: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/roles/command_role/index.md: 17: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/accessibility/aria/roles/index.md: 88: MD059/descriptive-link-text Link text should be descriptive [Context: "[link]"]␊
|
test-repos/mdn-content/files/en-us/web/accessibility/aria/roles/index.md: 88: MD059/descriptive-link-text Link text should be descriptive [Context: "[link]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/background_fetch_api/index.md: 89: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/background_fetch_api/index.md: 89: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/filesystem/index.md: 12: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/filesystem/index.md: 12: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/html_drag_and_drop_api/index.md: 243: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/html_drag_and_drop_api/index.md: 243: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/htmlanchorelement/index.md: 10: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/api/htmllinkelement/as/index.md: 17: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/api/htmllinkelement/index.md: 10: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/api/media_source_extensions_api/transcoding_assets_for_mse/index.md: 28: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/media_source_extensions_api/transcoding_assets_for_mse/index.md: 28: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/stylesheet/ownernode/index.md: 16: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/api/svgaelement/target/index.md: 19: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/api/webglrenderingcontext/getextension/index.md: 46: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/webglrenderingcontext/getextension/index.md: 46: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/api/webglrenderingcontext/getsupportedextensions/index.md: 44: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
test-repos/mdn-content/files/en-us/web/api/webglrenderingcontext/getsupportedextensions/index.md: 44: MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/_colon_any-link/index.md: 66: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`:link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/css/_colon_visited/index.md: 14: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`:link\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/css/_colon_visited/index.md: 24: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/css/css_media_queries/index.md: 131: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/css/css_media_queries/index.md: 132: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 18: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 18: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 19: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 19: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 20: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
test-repos/mdn-content/files/en-us/web/css/justify-items/index.md: 20: MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/html/attributes/rel/preconnect/index.md: 22: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
test-repos/mdn-content/files/en-us/web/html/attributes/rel/preconnect/index.md: 22: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/html/attributes/rel/preload/index.md: 105: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/http/headers/sec-purpose/index.md: 15: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/http/headers/sec-purpose/index.md: 16: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/http/headers/sec-purpose/index.md: 54: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/http/headers/sec-purpose/index.md: 92: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/javascript/guide/modules/index.md: 407: MD059/descriptive-link-text Link text should be descriptive [Context: "[\`<link>\`]"]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/performance/dns-prefetch/index.md: 74: MD059/descriptive-link-text Link text should be descriptive [Context: "[\\<link>]"]␊
|
test-repos/mdn-content/files/en-us/web/performance/dns-prefetch/index.md: 74: MD059/descriptive-link-text Link text should be descriptive [Context: "[\\<link>]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/performance/speculative_loading/index.md: 50: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
test-repos/mdn-content/files/en-us/web/performance/speculative_loading/index.md: 50: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
||||||
test-repos/mdn-content/files/en-us/web/performance/speculative_loading/index.md: 90: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
test-repos/mdn-content/files/en-us/web/performance/speculative_loading/index.md: 90: MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -70,8 +70,6 @@ text and ``\`code with ignored escaped \` backticks``
|
||||||
|
|
||||||
`` ` leading and trailing space allowed for backtick ` `` text `code`
|
`` ` leading and trailing space allowed for backtick ` `` text `code`
|
||||||
|
|
||||||
<!-- markdownlint-disable descriptive-link-text -->
|
|
||||||
|
|
||||||
Text [link](https://example.com/link`link) text `code`.
|
Text [link](https://example.com/link`link) text `code`.
|
||||||
|
|
||||||
Text [link](https://example.com/link```link) text ```code```.
|
Text [link](https://example.com/link```link) text ```code```.
|
||||||
|
@ -171,3 +169,5 @@ Text
|
||||||
Code
|
Code
|
||||||
```
|
```
|
||||||
Text
|
Text
|
||||||
|
|
||||||
|
<!-- markdownlint-disable-file descriptive-link-text -->
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# Heading
|
# Heading
|
||||||
|
|
||||||
|
<!-- markdownlint-disable-file descriptive-link-text emphasis-style line-length strong-style -->
|
||||||
|
|
||||||
Line with *Normal emphasis*
|
Line with *Normal emphasis*
|
||||||
|
|
||||||
Line with **Normal strong**
|
Line with **Normal strong**
|
||||||
|
@ -389,9 +391,3 @@ Emphasis <p data="* attribute *">* HTML *</p> {MD033} {MD037}
|
||||||
|
|
||||||
Embedded underscore is okay:
|
Embedded underscore is okay:
|
||||||
Text _emphas_i_s_ text _emphasis_
|
Text _emphas_i_s_ text _emphasis_
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
|
||||||
"emphasis-style": false,
|
|
||||||
"descriptive-link-text": false,
|
|
||||||
"strong-style": false
|
|
||||||
} -->
|
|
||||||
|
|
|
@ -38,6 +38,6 @@ code
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"code-block-style": false,
|
"code-block-style": false,
|
||||||
"heading-style": false,
|
"descriptive-link-text": false,
|
||||||
"descriptive-link-text": false
|
"heading-style": false
|
||||||
} -->
|
} -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue