mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-21 16:30:12 +01:00
Update to use named exports via / /async /promise /sync, simplify references via self-referencing, refine examples.
This commit is contained in:
parent
e41f034bef
commit
8da43dd246
96 changed files with 635 additions and 548 deletions
|
|
@ -6,9 +6,9 @@ import { getReferenceLinkImageData, filterByTypesCached } from "./cache.mjs";
|
|||
/**
|
||||
* Adds an error for a label space issue.
|
||||
*
|
||||
* @param {import("./markdownlint.mjs").RuleOnError} onError Error-reporting callback.
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} label Label token.
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} labelText LabelText token.
|
||||
* @param {import("markdownlint").RuleOnError} onError Error-reporting callback.
|
||||
* @param {import("markdownlint").MicromarkToken} label Label token.
|
||||
* @param {import("markdownlint").MicromarkToken} labelText LabelText token.
|
||||
* @param {boolean} isStart True iff error is at the start of the link.
|
||||
*/
|
||||
function addLabelSpaceError(onError, label, labelText, isStart) {
|
||||
|
|
@ -38,8 +38,8 @@ function addLabelSpaceError(onError, label, labelText, isStart) {
|
|||
/**
|
||||
* Determines if a link is a valid link (and not a fake shortcut link due to parser tricks).
|
||||
*
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} label Label token.
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} labelText LabelText token.
|
||||
* @param {import("markdownlint").MicromarkToken} label Label token.
|
||||
* @param {import("markdownlint").MicromarkToken} labelText LabelText token.
|
||||
* @param {Map<string, any>} definitions Map of link definitions.
|
||||
* @returns {boolean} True iff the link is valid.
|
||||
*/
|
||||
|
|
@ -47,7 +47,7 @@ function validLink(label, labelText, definitions) {
|
|||
return (label.parent?.children.length !== 1) || definitions.has(labelText.text.trim());
|
||||
}
|
||||
|
||||
/** @type {import("./markdownlint.mjs").Rule} */
|
||||
/** @type {import("markdownlint").Rule} */
|
||||
export default {
|
||||
"names": [ "MD039", "no-space-in-links" ],
|
||||
"description": "Spaces inside link text",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue