mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update MD005, MD007, MD022, MD037, MD038 to not report violations within "htmlFlow" context (fixes #999).
This commit is contained in:
parent
2a56f130c1
commit
63325edc97
15 changed files with 511 additions and 149 deletions
|
@ -1454,12 +1454,12 @@ function filterByPredicate(tokens, allowed, transformChildren) {
|
||||||
* Filter a list of Micromark tokens by type.
|
* Filter a list of Micromark tokens by type.
|
||||||
*
|
*
|
||||||
* @param {Token[]} tokens Micromark tokens.
|
* @param {Token[]} tokens Micromark tokens.
|
||||||
* @param {string[]} allowed Types to allow.
|
* @param {string[]} types Types to allow.
|
||||||
* @returns {Token[]} Filtered tokens.
|
* @returns {Token[]} Filtered tokens.
|
||||||
*/
|
*/
|
||||||
function filterByTypes(tokens, allowed) {
|
function filterByTypes(tokens, types) {
|
||||||
var predicate = function predicate(token) {
|
var predicate = function predicate(token) {
|
||||||
return allowed.includes(token.type);
|
return types.includes(token.type);
|
||||||
};
|
};
|
||||||
var flatTokens = tokens[flatTokensSymbol];
|
var flatTokens = tokens[flatTokensSymbol];
|
||||||
if (flatTokens) {
|
if (flatTokens) {
|
||||||
|
@ -1508,6 +1508,22 @@ function getHtmlTagInfo(token) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the nearest parent of the specified type for a Micromark token.
|
||||||
|
*
|
||||||
|
* @param {Token} token Micromark token.
|
||||||
|
* @param {string[]} types Types to allow.
|
||||||
|
* @returns {Token | null} Parent token.
|
||||||
|
*/
|
||||||
|
function getTokenParentOfType(token, types) {
|
||||||
|
/** @type {Token | null} */
|
||||||
|
var current = token;
|
||||||
|
while ((current = current.parent) && !types.includes(current.type)) {
|
||||||
|
// Empty
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the text of a single token from a list of Micromark tokens by type.
|
* Get the text of a single token from a list of Micromark tokens by type.
|
||||||
*
|
*
|
||||||
|
@ -1522,6 +1538,16 @@ function getTokenTextByType(tokens, type) {
|
||||||
return filtered.length === 1 ? filtered[0].text : null;
|
return filtered.length === 1 ? filtered[0].text : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a Micromark token has an htmlFlow-type parent.
|
||||||
|
*
|
||||||
|
* @param {Token} token Micromark token.
|
||||||
|
* @returns {boolean} True iff the token has an htmlFlow-type parent.
|
||||||
|
*/
|
||||||
|
function inHtmlFlow(token) {
|
||||||
|
return getTokenParentOfType(token, ["htmlFlow"]) !== null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines a list of Micromark tokens matches and returns a subset.
|
* Determines a list of Micromark tokens matches and returns a subset.
|
||||||
*
|
*
|
||||||
|
@ -1564,7 +1590,9 @@ module.exports = {
|
||||||
getHeadingLevel: getHeadingLevel,
|
getHeadingLevel: getHeadingLevel,
|
||||||
getHtmlTagInfo: getHtmlTagInfo,
|
getHtmlTagInfo: getHtmlTagInfo,
|
||||||
getMicromarkEvents: getMicromarkEvents,
|
getMicromarkEvents: getMicromarkEvents,
|
||||||
|
getTokenParentOfType: getTokenParentOfType,
|
||||||
getTokenTextByType: getTokenTextByType,
|
getTokenTextByType: getTokenTextByType,
|
||||||
|
inHtmlFlow: inHtmlFlow,
|
||||||
matchAndGetTokensByType: matchAndGetTokensByType,
|
matchAndGetTokensByType: matchAndGetTokensByType,
|
||||||
tokenIfType: tokenIfType
|
tokenIfType: tokenIfType
|
||||||
};
|
};
|
||||||
|
@ -3428,13 +3456,16 @@ var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
||||||
addError = _require.addError,
|
addError = _require.addError,
|
||||||
addErrorDetailIf = _require.addErrorDetailIf;
|
addErrorDetailIf = _require.addErrorDetailIf;
|
||||||
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
||||||
filterByTypes = _require2.filterByTypes;
|
filterByTypes = _require2.filterByTypes,
|
||||||
|
inHtmlFlow = _require2.inHtmlFlow;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": ["MD005", "list-indent"],
|
"names": ["MD005", "list-indent"],
|
||||||
"description": "Inconsistent indentation for list items at the same level",
|
"description": "Inconsistent indentation for list items at the same level",
|
||||||
"tags": ["bullet", "ul", "indentation"],
|
"tags": ["bullet", "ul", "indentation"],
|
||||||
"function": function MD005(params, onError) {
|
"function": function MD005(params, onError) {
|
||||||
var lists = filterByTypes(params.parsers.micromark.tokens, ["listOrdered", "listUnordered"]);
|
var lists = filterByTypes(params.parsers.micromark.tokens, ["listOrdered", "listUnordered"]).filter(function (list) {
|
||||||
|
return !inHtmlFlow(list);
|
||||||
|
});
|
||||||
var _iterator = _createForOfIteratorHelper(lists),
|
var _iterator = _createForOfIteratorHelper(lists),
|
||||||
_step;
|
_step;
|
||||||
try {
|
try {
|
||||||
|
@ -3570,12 +3601,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
||||||
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
||||||
addErrorDetailIf = _require.addErrorDetailIf;
|
addErrorDetailIf = _require.addErrorDetailIf;
|
||||||
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
||||||
filterByTypes = _require2.filterByTypes;
|
filterByTypes = _require2.filterByTypes,
|
||||||
|
getTokenParentOfType = _require2.getTokenParentOfType,
|
||||||
|
inHtmlFlow = _require2.inHtmlFlow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import("../helpers/micromark.cjs").Token} Token
|
* @typedef {import("../helpers/micromark.cjs").Token} Token
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var unorderedListTypes = ["blockQuotePrefix", "listItemPrefix", "listUnordered"];
|
||||||
|
var unorderedParentTypes = ["blockQuote", "listOrdered", "listUnordered"];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": ["MD007", "ul-indent"],
|
"names": ["MD007", "ul-indent"],
|
||||||
"description": "Unordered list indentation",
|
"description": "Unordered list indentation",
|
||||||
|
@ -3586,7 +3621,7 @@ module.exports = {
|
||||||
var startIndent = Number(params.config.start_indent || indent);
|
var startIndent = Number(params.config.start_indent || indent);
|
||||||
var unorderedListNesting = new Map();
|
var unorderedListNesting = new Map();
|
||||||
var lastBlockQuotePrefix = null;
|
var lastBlockQuotePrefix = null;
|
||||||
var tokens = filterByTypes(params.parsers.micromark.tokens, ["blockQuotePrefix", "listItemPrefix", "listUnordered"]);
|
var tokens = filterByTypes(params.parsers.micromark.tokens, unorderedListTypes);
|
||||||
var _iterator = _createForOfIteratorHelper(tokens),
|
var _iterator = _createForOfIteratorHelper(tokens),
|
||||||
_step;
|
_step;
|
||||||
try {
|
try {
|
||||||
|
@ -3602,20 +3637,19 @@ module.exports = {
|
||||||
var nesting = 0;
|
var nesting = 0;
|
||||||
/** @type {Token | null} */
|
/** @type {Token | null} */
|
||||||
var current = token;
|
var current = token;
|
||||||
while (current = current.parent) {
|
while (current = getTokenParentOfType(current, unorderedParentTypes)) {
|
||||||
if (current.type === "listUnordered") {
|
if (current.type === "listUnordered") {
|
||||||
nesting++;
|
nesting++;
|
||||||
|
continue;
|
||||||
} else if (current.type === "listOrdered") {
|
} else if (current.type === "listOrdered") {
|
||||||
nesting = -1;
|
nesting = -1;
|
||||||
break;
|
|
||||||
} else if (current.type === "blockQuote") {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (nesting >= 0) {
|
if (nesting >= 0) {
|
||||||
unorderedListNesting.set(token, nesting);
|
unorderedListNesting.set(token, nesting);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!inHtmlFlow(token)) {
|
||||||
// listItemPrefix
|
// listItemPrefix
|
||||||
var _nesting = unorderedListNesting.get(parent);
|
var _nesting = unorderedListNesting.get(parent);
|
||||||
if (_nesting !== undefined) {
|
if (_nesting !== undefined) {
|
||||||
|
@ -4306,7 +4340,8 @@ var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
||||||
isBlankLine = _require.isBlankLine;
|
isBlankLine = _require.isBlankLine;
|
||||||
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
||||||
filterByTypes = _require2.filterByTypes,
|
filterByTypes = _require2.filterByTypes,
|
||||||
getHeadingLevel = _require2.getHeadingLevel;
|
getHeadingLevel = _require2.getHeadingLevel,
|
||||||
|
inHtmlFlow = _require2.inHtmlFlow;
|
||||||
var defaultLines = 1;
|
var defaultLines = 1;
|
||||||
var getLinesFunction = function getLinesFunction(linesParam) {
|
var getLinesFunction = function getLinesFunction(linesParam) {
|
||||||
if (Array.isArray(linesParam)) {
|
if (Array.isArray(linesParam)) {
|
||||||
|
@ -4349,7 +4384,9 @@ module.exports = {
|
||||||
var getLinesBelow = getLinesFunction(params.config.lines_below);
|
var getLinesBelow = getLinesFunction(params.config.lines_below);
|
||||||
var lines = params.lines,
|
var lines = params.lines,
|
||||||
parsers = params.parsers;
|
parsers = params.parsers;
|
||||||
var headings = filterByTypes(parsers.micromark.tokens, ["atxHeading", "setextHeading"]);
|
var headings = filterByTypes(parsers.micromark.tokens, ["atxHeading", "setextHeading"]).filter(function (heading) {
|
||||||
|
return !inHtmlFlow(heading);
|
||||||
|
});
|
||||||
var _iterator2 = _createForOfIteratorHelper(headings),
|
var _iterator2 = _createForOfIteratorHelper(headings),
|
||||||
_step2;
|
_step2;
|
||||||
try {
|
try {
|
||||||
|
@ -5327,7 +5364,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
||||||
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
||||||
addError = _require.addError;
|
addError = _require.addError;
|
||||||
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
||||||
filterByPredicate = _require2.filterByPredicate;
|
filterByPredicate = _require2.filterByPredicate,
|
||||||
|
inHtmlFlow = _require2.inHtmlFlow;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": ["MD037", "no-space-in-emphasis"],
|
"names": ["MD037", "no-space-in-emphasis"],
|
||||||
"description": "Spaces inside emphasis markers",
|
"description": "Spaces inside emphasis markers",
|
||||||
|
@ -5373,7 +5411,7 @@ module.exports = {
|
||||||
type = child.type;
|
type = child.type;
|
||||||
if (type === "data" && text.length <= 3) {
|
if (type === "data" && text.length <= 3) {
|
||||||
var _emphasisTokens = emphasisTokensByMarker.get(text);
|
var _emphasisTokens = emphasisTokensByMarker.get(text);
|
||||||
if (_emphasisTokens) {
|
if (_emphasisTokens && !inHtmlFlow(child)) {
|
||||||
_emphasisTokens.push(child);
|
_emphasisTokens.push(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5459,6 +5497,7 @@ var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
||||||
addErrorContext = _require.addErrorContext;
|
addErrorContext = _require.addErrorContext;
|
||||||
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"),
|
||||||
filterByTypes = _require2.filterByTypes,
|
filterByTypes = _require2.filterByTypes,
|
||||||
|
inHtmlFlow = _require2.inHtmlFlow,
|
||||||
tokenIfType = _require2.tokenIfType;
|
tokenIfType = _require2.tokenIfType;
|
||||||
var leftSpaceRe = /^\s(?:[^`]|$)/;
|
var leftSpaceRe = /^\s(?:[^`]|$)/;
|
||||||
var rightSpaceRe = /[^`]\s$/;
|
var rightSpaceRe = /[^`]\s$/;
|
||||||
|
@ -5477,13 +5516,15 @@ module.exports = {
|
||||||
"description": "Spaces inside code span elements",
|
"description": "Spaces inside code span elements",
|
||||||
"tags": ["whitespace", "code"],
|
"tags": ["whitespace", "code"],
|
||||||
"function": function MD038(params, onError) {
|
"function": function MD038(params, onError) {
|
||||||
var codeTextTokens = filterByTypes(params.parsers.micromark.tokens, ["codeText"]);
|
var codeTexts = filterByTypes(params.parsers.micromark.tokens, ["codeText"]).filter(function (codeText) {
|
||||||
var _iterator = _createForOfIteratorHelper(codeTextTokens),
|
return !inHtmlFlow(codeText);
|
||||||
|
});
|
||||||
|
var _iterator = _createForOfIteratorHelper(codeTexts),
|
||||||
_step;
|
_step;
|
||||||
try {
|
try {
|
||||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||||
var token = _step.value;
|
var codeText = _step.value;
|
||||||
var children = token.children;
|
var children = codeText.children;
|
||||||
var first = 0;
|
var first = 0;
|
||||||
var last = children.length - 1;
|
var last = children.length - 1;
|
||||||
var startSequence = tokenIfType(children[first], "codeTextSequence");
|
var startSequence = tokenIfType(children[first], "codeTextSequence");
|
||||||
|
|
|
@ -281,11 +281,11 @@ function filterByPredicate(tokens, allowed, transformChildren) {
|
||||||
* Filter a list of Micromark tokens by type.
|
* Filter a list of Micromark tokens by type.
|
||||||
*
|
*
|
||||||
* @param {Token[]} tokens Micromark tokens.
|
* @param {Token[]} tokens Micromark tokens.
|
||||||
* @param {string[]} allowed Types to allow.
|
* @param {string[]} types Types to allow.
|
||||||
* @returns {Token[]} Filtered tokens.
|
* @returns {Token[]} Filtered tokens.
|
||||||
*/
|
*/
|
||||||
function filterByTypes(tokens, allowed) {
|
function filterByTypes(tokens, types) {
|
||||||
const predicate = (token) => allowed.includes(token.type);
|
const predicate = (token) => types.includes(token.type);
|
||||||
const flatTokens = tokens[flatTokensSymbol];
|
const flatTokens = tokens[flatTokensSymbol];
|
||||||
if (flatTokens) {
|
if (flatTokens) {
|
||||||
return flatTokens.filter(predicate);
|
return flatTokens.filter(predicate);
|
||||||
|
@ -336,6 +336,22 @@ function getHtmlTagInfo(token) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the nearest parent of the specified type for a Micromark token.
|
||||||
|
*
|
||||||
|
* @param {Token} token Micromark token.
|
||||||
|
* @param {string[]} types Types to allow.
|
||||||
|
* @returns {Token | null} Parent token.
|
||||||
|
*/
|
||||||
|
function getTokenParentOfType(token, types) {
|
||||||
|
/** @type {Token | null} */
|
||||||
|
let current = token;
|
||||||
|
while ((current = current.parent) && !types.includes(current.type)) {
|
||||||
|
// Empty
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the text of a single token from a list of Micromark tokens by type.
|
* Get the text of a single token from a list of Micromark tokens by type.
|
||||||
*
|
*
|
||||||
|
@ -348,6 +364,16 @@ function getTokenTextByType(tokens, type) {
|
||||||
return (filtered.length === 1) ? filtered[0].text : null;
|
return (filtered.length === 1) ? filtered[0].text : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a Micromark token has an htmlFlow-type parent.
|
||||||
|
*
|
||||||
|
* @param {Token} token Micromark token.
|
||||||
|
* @returns {boolean} True iff the token has an htmlFlow-type parent.
|
||||||
|
*/
|
||||||
|
function inHtmlFlow(token) {
|
||||||
|
return getTokenParentOfType(token, [ "htmlFlow" ]) !== null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines a list of Micromark tokens matches and returns a subset.
|
* Determines a list of Micromark tokens matches and returns a subset.
|
||||||
*
|
*
|
||||||
|
@ -391,7 +417,9 @@ module.exports = {
|
||||||
getHeadingLevel,
|
getHeadingLevel,
|
||||||
getHtmlTagInfo,
|
getHtmlTagInfo,
|
||||||
getMicromarkEvents,
|
getMicromarkEvents,
|
||||||
|
getTokenParentOfType,
|
||||||
getTokenTextByType,
|
getTokenTextByType,
|
||||||
|
inHtmlFlow,
|
||||||
matchAndGetTokensByType,
|
matchAndGetTokensByType,
|
||||||
tokenIfType
|
tokenIfType
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { addError, addErrorDetailIf } = require("../helpers");
|
const { addError, addErrorDetailIf } = require("../helpers");
|
||||||
const { filterByTypes } = require("../helpers/micromark.cjs");
|
const { filterByTypes, inHtmlFlow } = require("../helpers/micromark.cjs");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD005", "list-indent" ],
|
"names": [ "MD005", "list-indent" ],
|
||||||
|
@ -13,7 +13,7 @@ module.exports = {
|
||||||
const lists = filterByTypes(
|
const lists = filterByTypes(
|
||||||
params.parsers.micromark.tokens,
|
params.parsers.micromark.tokens,
|
||||||
[ "listOrdered", "listUnordered" ]
|
[ "listOrdered", "listUnordered" ]
|
||||||
);
|
).filter((list) => !inHtmlFlow(list));
|
||||||
for (const list of lists) {
|
for (const list of lists) {
|
||||||
const expectedIndent = list.startColumn - 1;
|
const expectedIndent = list.startColumn - 1;
|
||||||
let expectedEnd = 0;
|
let expectedEnd = 0;
|
||||||
|
|
21
lib/md007.js
21
lib/md007.js
|
@ -3,12 +3,18 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { addErrorDetailIf } = require("../helpers");
|
const { addErrorDetailIf } = require("../helpers");
|
||||||
const { filterByTypes } = require("../helpers/micromark.cjs");
|
const { filterByTypes, getTokenParentOfType, inHtmlFlow } =
|
||||||
|
require("../helpers/micromark.cjs");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import("../helpers/micromark.cjs").Token} Token
|
* @typedef {import("../helpers/micromark.cjs").Token} Token
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const unorderedListTypes =
|
||||||
|
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ];
|
||||||
|
const unorderedParentTypes =
|
||||||
|
[ "blockQuote", "listOrdered", "listUnordered" ];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD007", "ul-indent" ],
|
"names": [ "MD007", "ul-indent" ],
|
||||||
"description": "Unordered list indentation",
|
"description": "Unordered list indentation",
|
||||||
|
@ -21,7 +27,7 @@ module.exports = {
|
||||||
let lastBlockQuotePrefix = null;
|
let lastBlockQuotePrefix = null;
|
||||||
const tokens = filterByTypes(
|
const tokens = filterByTypes(
|
||||||
params.parsers.micromark.tokens,
|
params.parsers.micromark.tokens,
|
||||||
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ]
|
unorderedListTypes
|
||||||
);
|
);
|
||||||
for (const token of tokens) {
|
for (const token of tokens) {
|
||||||
const { parent, startColumn, startLine, type } = token;
|
const { parent, startColumn, startLine, type } = token;
|
||||||
|
@ -31,20 +37,21 @@ module.exports = {
|
||||||
let nesting = 0;
|
let nesting = 0;
|
||||||
/** @type {Token | null} */
|
/** @type {Token | null} */
|
||||||
let current = token;
|
let current = token;
|
||||||
while ((current = current.parent)) {
|
while (
|
||||||
|
(current = getTokenParentOfType(current, unorderedParentTypes))
|
||||||
|
) {
|
||||||
if (current.type === "listUnordered") {
|
if (current.type === "listUnordered") {
|
||||||
nesting++;
|
nesting++;
|
||||||
|
continue;
|
||||||
} else if (current.type === "listOrdered") {
|
} else if (current.type === "listOrdered") {
|
||||||
nesting = -1;
|
nesting = -1;
|
||||||
break;
|
|
||||||
} else if (current.type === "blockQuote") {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (nesting >= 0) {
|
if (nesting >= 0) {
|
||||||
unorderedListNesting.set(token, nesting);
|
unorderedListNesting.set(token, nesting);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!inHtmlFlow(token)) {
|
||||||
// listItemPrefix
|
// listItemPrefix
|
||||||
const nesting = unorderedListNesting.get(parent);
|
const nesting = unorderedListNesting.get(parent);
|
||||||
if (nesting !== undefined) {
|
if (nesting !== undefined) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
const { addErrorDetailIf, blockquotePrefixRe, isBlankLine } =
|
const { addErrorDetailIf, blockquotePrefixRe, isBlankLine } =
|
||||||
require("../helpers");
|
require("../helpers");
|
||||||
const { filterByTypes, getHeadingLevel } =
|
const { filterByTypes, getHeadingLevel, inHtmlFlow } =
|
||||||
require("../helpers/micromark.cjs");
|
require("../helpers/micromark.cjs");
|
||||||
|
|
||||||
const defaultLines = 1;
|
const defaultLines = 1;
|
||||||
|
@ -42,7 +42,7 @@ module.exports = {
|
||||||
const headings = filterByTypes(
|
const headings = filterByTypes(
|
||||||
parsers.micromark.tokens,
|
parsers.micromark.tokens,
|
||||||
[ "atxHeading", "setextHeading" ]
|
[ "atxHeading", "setextHeading" ]
|
||||||
);
|
).filter((heading) => !inHtmlFlow(heading));
|
||||||
for (const heading of headings) {
|
for (const heading of headings) {
|
||||||
const { startLine, endLine } = heading;
|
const { startLine, endLine } = heading;
|
||||||
const line = lines[startLine - 1].trim();
|
const line = lines[startLine - 1].trim();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { addError } = require("../helpers");
|
const { addError } = require("../helpers");
|
||||||
const { filterByPredicate } = require("../helpers/micromark.cjs");
|
const { filterByPredicate, inHtmlFlow } = require("../helpers/micromark.cjs");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD037", "no-space-in-emphasis" ],
|
"names": [ "MD037", "no-space-in-emphasis" ],
|
||||||
|
@ -31,7 +31,7 @@ module.exports = {
|
||||||
const { text, type } = child;
|
const { text, type } = child;
|
||||||
if ((type === "data") && (text.length <= 3)) {
|
if ((type === "data") && (text.length <= 3)) {
|
||||||
const emphasisTokens = emphasisTokensByMarker.get(text);
|
const emphasisTokens = emphasisTokensByMarker.get(text);
|
||||||
if (emphasisTokens) {
|
if (emphasisTokens && !inHtmlFlow(child)) {
|
||||||
emphasisTokens.push(child);
|
emphasisTokens.push(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
lib/md038.js
12
lib/md038.js
|
@ -3,7 +3,8 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { addErrorContext } = require("../helpers");
|
const { addErrorContext } = require("../helpers");
|
||||||
const { filterByTypes, tokenIfType } = require("../helpers/micromark.cjs");
|
const { filterByTypes, inHtmlFlow, tokenIfType } =
|
||||||
|
require("../helpers/micromark.cjs");
|
||||||
|
|
||||||
const leftSpaceRe = /^\s(?:[^`]|$)/;
|
const leftSpaceRe = /^\s(?:[^`]|$)/;
|
||||||
const rightSpaceRe = /[^`]\s$/;
|
const rightSpaceRe = /[^`]\s$/;
|
||||||
|
@ -23,10 +24,11 @@ module.exports = {
|
||||||
"description": "Spaces inside code span elements",
|
"description": "Spaces inside code span elements",
|
||||||
"tags": [ "whitespace", "code" ],
|
"tags": [ "whitespace", "code" ],
|
||||||
"function": function MD038(params, onError) {
|
"function": function MD038(params, onError) {
|
||||||
const codeTextTokens =
|
const codeTexts =
|
||||||
filterByTypes(params.parsers.micromark.tokens, [ "codeText" ]);
|
filterByTypes(params.parsers.micromark.tokens, [ "codeText" ])
|
||||||
for (const token of codeTextTokens) {
|
.filter((codeText) => !inHtmlFlow(codeText));
|
||||||
const { children } = token;
|
for (const codeText of codeTexts) {
|
||||||
|
const { children } = codeText;
|
||||||
const first = 0;
|
const first = 0;
|
||||||
const last = children.length - 1;
|
const last = children.length - 1;
|
||||||
const startSequence = tokenIfType(children[first], "codeTextSequence");
|
const startSequence = tokenIfType(children[first], "codeTextSequence");
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
*comment *
|
*comment *
|
||||||
*comment * -->
|
*comment * -->
|
||||||
|
|
||||||
<!--> *{MD037} * -->
|
<!--> *text * -->
|
||||||
|
|
||||||
<!---> *{MD037} * -->
|
<!---> *text * -->
|
||||||
|
|
||||||
<!-- *comment * --->
|
<!-- *comment * --->
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ hard tab / space *in * emphasis / space `in ` code <!-- markdownlint-disable-lin
|
||||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||||
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space `in ` code
|
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space `in ` code
|
||||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||||
<!-- markdownlint-disable-line MD010 MD038 --> hard tab / space *in * emphasis {MD037} / space `in ` code
|
<!-- markdownlint-disable-line MD010 --> hard tab / space *in * emphasis / space `in ` code
|
||||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||||
hard tab / space *in * emphasis {MD037} / space `in ` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->
|
hard tab / space *in * emphasis {MD037} / space `in ` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->
|
||||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||||
|
|
37
test/markdown-in-html.md
Normal file
37
test/markdown-in-html.md
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Markdown in HTML
|
||||||
|
|
||||||
|
Text
|
||||||
|
|
||||||
|
+ Item
|
||||||
|
|
||||||
|
Text
|
||||||
|
|
||||||
|
<p>
|
||||||
|
## Heading 2a
|
||||||
|
- Text *text* text * text * text ** text ** text `text` text ` text ` text
|
||||||
|
- Text https://example.com/ [ link ](https://example.com/)
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
### Heading 3a ###
|
||||||
|
Text
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Text
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
## Heading 2b {MD019} {MD022}
|
||||||
|
- Text *text* text * text * text ** text ** text `text` text ` text ` text {MD004} {MD007} {MD032} {MD037} {MD038}
|
||||||
|
- Text https://example.com/ [ link ](https://example.com/) {MD004} {MD005} {MD039}
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
### Heading 3b {MD003} {MD021} {MD022} ###
|
||||||
|
Text
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!-- markdownlint-disable-file MD013 MD033 -->
|
|
@ -42,11 +42,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 60: MD045/no-alt-text Images should have alternate text (alt text)␊
|
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 60: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 71: MD045/no-alt-text Images should have alternate text (alt text)␊
|
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 71: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 67: MD045/no-alt-text Images should have alternate text (alt text)␊
|
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 67: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||||
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 251: MD045/no-alt-text Images should have alternate text (alt text)␊
|
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 251: MD045/no-alt-text Images should have alternate text (alt text)`
|
||||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 234: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 10]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 556: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 769: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]␊
|
|
||||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 838: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]`
|
|
||||||
|
|
||||||
## https://github.com/mkdocs/mkdocs
|
## https://github.com/mkdocs/mkdocs
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -18250,44 +18250,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
|
|
||||||
{
|
{
|
||||||
errors: [
|
errors: [
|
||||||
{
|
|
||||||
errorContext: '} *',
|
|
||||||
errorDetail: null,
|
|
||||||
errorRange: [
|
|
||||||
14,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
editColumn: 15,
|
|
||||||
},
|
|
||||||
lineNumber: 22,
|
|
||||||
ruleDescription: 'Spaces inside emphasis markers',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD037',
|
|
||||||
'no-space-in-emphasis',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: '} *',
|
|
||||||
errorDetail: null,
|
|
||||||
errorRange: [
|
|
||||||
15,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
editColumn: 16,
|
|
||||||
},
|
|
||||||
lineNumber: 24,
|
|
||||||
ruleDescription: 'Spaces inside emphasis markers',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD037',
|
|
||||||
'no-space-in-emphasis',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: '} *',
|
errorContext: '} *',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
|
@ -18348,9 +18310,9 @@ Generated by [AVA](https://avajs.dev).
|
||||||
*comment *␊
|
*comment *␊
|
||||||
*comment * -->␊
|
*comment * -->␊
|
||||||
␊
|
␊
|
||||||
<!--> *{MD037}* -->␊
|
<!--> *text * -->␊
|
||||||
␊
|
␊
|
||||||
<!---> *{MD037}* -->␊
|
<!---> *text * -->␊
|
||||||
␊
|
␊
|
||||||
<!-- *comment * --->␊
|
<!-- *comment * --->␊
|
||||||
␊
|
␊
|
||||||
|
@ -22064,25 +22026,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'no-space-in-emphasis',
|
'no-space-in-emphasis',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: 'n *',
|
|
||||||
errorDetail: null,
|
|
||||||
errorRange: [
|
|
||||||
67,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
editColumn: 68,
|
|
||||||
},
|
|
||||||
lineNumber: 98,
|
|
||||||
ruleDescription: 'Spaces inside emphasis markers',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD037',
|
|
||||||
'no-space-in-emphasis',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: 'n *',
|
errorContext: 'n *',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
|
@ -22835,7 +22778,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||||
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space \`in \` code␊
|
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space \`in \` code␊
|
||||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||||
<!-- markdownlint-disable-line MD010 MD038 --> hard tab / space *in* emphasis {MD037} / space \`in \` code␊
|
<!-- markdownlint-disable-line MD010 --> hard tab / space *in * emphasis / space \`in \` code␊
|
||||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||||
hard tab / space *in* emphasis {MD037} / space \`in \` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->␊
|
hard tab / space *in* emphasis {MD037} / space \`in \` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->␊
|
||||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||||
|
@ -33077,6 +33020,352 @@ Generated by [AVA](https://avajs.dev).
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## markdown-in-html.md
|
||||||
|
|
||||||
|
> Snapshot 1
|
||||||
|
|
||||||
|
{
|
||||||
|
errors: [
|
||||||
|
{
|
||||||
|
errorContext: null,
|
||||||
|
errorDetail: 'Expected: atx; Actual: atx_closed',
|
||||||
|
errorRange: null,
|
||||||
|
fixInfo: null,
|
||||||
|
lineNumber: 32,
|
||||||
|
ruleDescription: 'Heading style',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD003',
|
||||||
|
'heading-style',
|
||||||
|
'header-style',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: null,
|
||||||
|
errorDetail: 'Expected: plus; Actual: dash',
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 2,
|
||||||
|
insertText: '+',
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Unordered list style',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD004',
|
||||||
|
'ul-style',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: null,
|
||||||
|
errorDetail: 'Expected: plus; Actual: dash',
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 1,
|
||||||
|
insertText: '+',
|
||||||
|
},
|
||||||
|
lineNumber: 26,
|
||||||
|
ruleDescription: 'Unordered list style',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD004',
|
||||||
|
'ul-style',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: null,
|
||||||
|
errorDetail: 'Expected: 1; Actual: 0',
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
fixInfo: null,
|
||||||
|
lineNumber: 26,
|
||||||
|
ruleDescription: 'Inconsistent indentation for list items at the same level',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD005',
|
||||||
|
'list-indent',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: null,
|
||||||
|
errorDetail: 'Expected: 0; Actual: 1',
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 1,
|
||||||
|
insertText: '',
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Unordered list indentation',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD007',
|
||||||
|
'ul-indent',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '## Heading 2b {MD019} {MD022}',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 3,
|
||||||
|
},
|
||||||
|
lineNumber: 24,
|
||||||
|
ruleDescription: 'Multiple spaces after hash on atx style heading',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD019',
|
||||||
|
'no-multiple-space-atx',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '### Heading 3b...1} {MD022} ###',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
1,
|
||||||
|
6,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 44,
|
||||||
|
editColumn: 1,
|
||||||
|
insertText: '### Heading 3b {MD003} {MD021} {MD022} ###',
|
||||||
|
},
|
||||||
|
lineNumber: 32,
|
||||||
|
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD021',
|
||||||
|
'no-multiple-space-closed-atx',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '## Heading 2b {MD019} {MD022}',
|
||||||
|
errorDetail: 'Expected: 1; Actual: 0; Below',
|
||||||
|
errorRange: null,
|
||||||
|
fixInfo: {
|
||||||
|
insertText: `␊
|
||||||
|
`,
|
||||||
|
lineNumber: 25,
|
||||||
|
},
|
||||||
|
lineNumber: 24,
|
||||||
|
ruleDescription: 'Headings should be surrounded by blank lines',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD022',
|
||||||
|
'blanks-around-headings',
|
||||||
|
'blanks-around-headers',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '### Heading 3b {MD003} {MD021} {MD022} ###',
|
||||||
|
errorDetail: 'Expected: 1; Actual: 0; Below',
|
||||||
|
errorRange: null,
|
||||||
|
fixInfo: {
|
||||||
|
insertText: `␊
|
||||||
|
`,
|
||||||
|
lineNumber: 33,
|
||||||
|
},
|
||||||
|
lineNumber: 32,
|
||||||
|
ruleDescription: 'Headings should be surrounded by blank lines',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD022',
|
||||||
|
'blanks-around-headings',
|
||||||
|
'blanks-around-headers',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '- Text *text* text * text * te...',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: null,
|
||||||
|
fixInfo: {
|
||||||
|
insertText: `␊
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Lists should be surrounded by blank lines',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD032',
|
||||||
|
'blanks-around-lists',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '* t',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
21,
|
||||||
|
3,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 22,
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Spaces inside emphasis markers',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD037',
|
||||||
|
'no-space-in-emphasis',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: 't *',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
26,
|
||||||
|
3,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 27,
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Spaces inside emphasis markers',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD037',
|
||||||
|
'no-space-in-emphasis',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '** t',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
35,
|
||||||
|
4,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 37,
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Spaces inside emphasis markers',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD037',
|
||||||
|
'no-space-in-emphasis',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: 't **',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
41,
|
||||||
|
4,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 1,
|
||||||
|
editColumn: 42,
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Spaces inside emphasis markers',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD037',
|
||||||
|
'no-space-in-emphasis',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '` text `',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
63,
|
||||||
|
10,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 8,
|
||||||
|
editColumn: 64,
|
||||||
|
insertText: 'text',
|
||||||
|
},
|
||||||
|
lineNumber: 25,
|
||||||
|
ruleDescription: 'Spaces inside code span elements',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD038',
|
||||||
|
'no-space-in-code',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorContext: '[ link ]',
|
||||||
|
errorDetail: null,
|
||||||
|
errorRange: [
|
||||||
|
29,
|
||||||
|
8,
|
||||||
|
],
|
||||||
|
fixInfo: {
|
||||||
|
deleteCount: 6,
|
||||||
|
editColumn: 30,
|
||||||
|
insertText: 'link',
|
||||||
|
},
|
||||||
|
lineNumber: 26,
|
||||||
|
ruleDescription: 'Spaces inside link text',
|
||||||
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md',
|
||||||
|
ruleNames: [
|
||||||
|
'MD039',
|
||||||
|
'no-space-in-links',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
fixed: `# Markdown in HTML␊
|
||||||
|
␊
|
||||||
|
Text␊
|
||||||
|
␊
|
||||||
|
+ Item␊
|
||||||
|
␊
|
||||||
|
Text␊
|
||||||
|
␊
|
||||||
|
<p>␊
|
||||||
|
## Heading 2a␊
|
||||||
|
- Text *text* text * text * text ** text ** text \`text\` text \` text \` text␊
|
||||||
|
- Text https://example.com/ [ link ](https://example.com/)␊
|
||||||
|
</p>␊
|
||||||
|
␊
|
||||||
|
<p>␊
|
||||||
|
### Heading 3a ###␊
|
||||||
|
Text␊
|
||||||
|
</p>␊
|
||||||
|
␊
|
||||||
|
Text␊
|
||||||
|
␊
|
||||||
|
<p>␊
|
||||||
|
␊
|
||||||
|
## Heading 2b {MD019} {MD022}␊
|
||||||
|
␊
|
||||||
|
+ Text *text* text *text* text **text** text \`text\` text \`text\` text {MD004} {MD007} {MD032} {MD037} {MD038}␊
|
||||||
|
+ Text https://example.com/ [link](https://example.com/) {MD004} {MD005} {MD039}␊
|
||||||
|
␊
|
||||||
|
</p>␊
|
||||||
|
␊
|
||||||
|
<p>␊
|
||||||
|
␊
|
||||||
|
### Heading 3b {MD003} {MD021} {MD022} ###␊
|
||||||
|
␊
|
||||||
|
Text␊
|
||||||
|
␊
|
||||||
|
</p>␊
|
||||||
|
␊
|
||||||
|
<!-- markdownlint-disable-file MD013 MD033 -->␊
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
|
||||||
## mathjax-scenarios.md
|
## mathjax-scenarios.md
|
||||||
|
|
||||||
> Snapshot 1
|
> Snapshot 1
|
||||||
|
@ -45551,44 +45840,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'no-space-in-emphasis',
|
'no-space-in-emphasis',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: '* H',
|
|
||||||
errorDetail: null,
|
|
||||||
errorRange: [
|
|
||||||
17,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
editColumn: 18,
|
|
||||||
},
|
|
||||||
lineNumber: 383,
|
|
||||||
ruleDescription: 'Spaces inside emphasis markers',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD037',
|
|
||||||
'no-space-in-emphasis',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: 'L *',
|
|
||||||
errorDetail: null,
|
|
||||||
errorRange: [
|
|
||||||
22,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
editColumn: 23,
|
|
||||||
},
|
|
||||||
lineNumber: 383,
|
|
||||||
ruleDescription: 'Spaces inside emphasis markers',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD037',
|
|
||||||
'no-space-in-emphasis',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: '* H',
|
errorContext: '* H',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
|
@ -46010,7 +46261,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
Emphasis <b>inside *HTML* content</b> {MD033} {MD037}␊
|
Emphasis <b>inside *HTML* content</b> {MD033} {MD037}␊
|
||||||
␊
|
␊
|
||||||
<p> {MD033}␊
|
<p> {MD033}␊
|
||||||
Emphasis inside *HTML* content {MD037}␊
|
Emphasis inside * HTML * content␊
|
||||||
</p>␊
|
</p>␊
|
||||||
␊
|
␊
|
||||||
Emphasis <p data="inside * attribute * content"></p> {MD033}␊
|
Emphasis <p data="inside * attribute * content"></p> {MD033}␊
|
||||||
|
|
Binary file not shown.
|
@ -380,7 +380,7 @@ Partial *em*phasis of a *wo*rd.
|
||||||
Emphasis <b>inside * HTML * content</b> {MD033} {MD037}
|
Emphasis <b>inside * HTML * content</b> {MD033} {MD037}
|
||||||
|
|
||||||
<p> {MD033}
|
<p> {MD033}
|
||||||
Emphasis inside * HTML * content {MD037}
|
Emphasis inside * HTML * content
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Emphasis <p data="inside * attribute * content"></p> {MD033}
|
Emphasis <p data="inside * attribute * content"></p> {MD033}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue