mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Update MD052/reference-links-images to add ignored_labels parameter and default to ignoring GFM task list items (fixes #1524).
This commit is contained in:
parent
c413ac9a88
commit
328506e6c8
19 changed files with 357 additions and 12 deletions
|
|
@ -13,6 +13,7 @@ export default {
|
|||
"function": function MD052(params, onError) {
|
||||
const { config, lines } = params;
|
||||
const shortcutSyntax = config.shortcut_syntax || false;
|
||||
const ignoredLabels = new Set(config.ignored_labels || [ "x" ]);
|
||||
const { definitions, references, shortcuts } = getReferenceLinkImageData();
|
||||
const entries = shortcutSyntax ?
|
||||
[ ...references.entries(), ...shortcuts.entries() ] :
|
||||
|
|
@ -20,7 +21,7 @@ export default {
|
|||
// Look for links/images that use an undefined link reference
|
||||
for (const reference of entries) {
|
||||
const [ label, datas ] = reference;
|
||||
if (!definitions.has(label)) {
|
||||
if (!definitions.has(label) && !ignoredLabels.has(label)) {
|
||||
for (const data of datas) {
|
||||
const [ lineIndex, index, length ] = data;
|
||||
// Context will be incomplete if reporting for a multi-line link
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue