mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update to version 0.21.0.
This commit is contained in:
parent
281de5ae2b
commit
59eaa869fc
4 changed files with 54 additions and 31 deletions
|
@ -901,6 +901,10 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|||
* 0.20.2 - Fix regression in MD037, improve MD038.
|
||||
* 0.20.3 - Fix regression in MD037, improve MD044, add automatic regression testing.
|
||||
* 0.20.4 - Fix regression in MD037, improve MD034/MD044, improve documentation.
|
||||
* 0.21.0 - Lint concurrently for better performance (async only), add Promise-based APIs,
|
||||
update TypeScript declaration file, hide `toString` on `LintResults`, add ability
|
||||
to fix in browser demo, allow custom rules in `.markdownlint.json` schema, improve
|
||||
MD042/MD044, improve documentation, update dependencies.
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
||||
[npm-url]: https://www.npmjs.com/package/markdownlint
|
||||
|
|
|
@ -3217,6 +3217,24 @@ module.exports = {
|
|||
names = Array.isArray(names) ? names : [];
|
||||
var codeBlocks = params.config.code_blocks;
|
||||
var includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
|
||||
// Text of automatic hyperlinks is implicitly a URL
|
||||
var autolinkText = new Set();
|
||||
filterTokens(params, "inline", function (token) {
|
||||
var inAutoLink = false;
|
||||
token.children.forEach(function (child) {
|
||||
var info = child.info, type = child.type;
|
||||
if ((type === "link_open") && (info === "auto")) {
|
||||
inAutoLink = true;
|
||||
}
|
||||
else if (type === "link_close") {
|
||||
inAutoLink = false;
|
||||
}
|
||||
else if ((type === "text") && inAutoLink) {
|
||||
autolinkText.add(child);
|
||||
}
|
||||
});
|
||||
});
|
||||
// For each proper name...
|
||||
names.forEach(function (name) {
|
||||
var escapedName = escapeForRegExp(name);
|
||||
var startNamePattern = startNonWordRe.test(name) ? "" : "\\S*\\b";
|
||||
|
@ -3225,9 +3243,9 @@ module.exports = {
|
|||
var anyNameRe = new RegExp(namePattern, "gi");
|
||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||
function forToken(token) {
|
||||
var fenceOffset = (token.type === "fence") ? 1 : 0;
|
||||
token.content.split(newLineRe)
|
||||
.forEach(function (line, index) {
|
||||
if (!autolinkText.has(token)) {
|
||||
var fenceOffset_1 = (token.type === "fence") ? 1 : 0;
|
||||
token.content.split(newLineRe).forEach(function (line, index) {
|
||||
var match = null;
|
||||
while ((match = anyNameRe.exec(line)) !== null) {
|
||||
var fullMatch = match[0], leftMatch = match[1], nameMatch = match[2], rightMatch = match[3];
|
||||
|
@ -3236,7 +3254,7 @@ module.exports = {
|
|||
.replace(new RegExp("^\\W{0," + leftMatch.length + "}"), "")
|
||||
.replace(new RegExp("\\W{0," + rightMatch.length + "}$"), "");
|
||||
if (!names.includes(wordMatch)) {
|
||||
var lineNumber = token.lineNumber + index + fenceOffset;
|
||||
var lineNumber = token.lineNumber + index + fenceOffset_1;
|
||||
var fullLine = params.lines[lineNumber - 1];
|
||||
var matchLength = wordMatch.length;
|
||||
var matchIndex = fullLine.indexOf(wordMatch);
|
||||
|
@ -3256,6 +3274,7 @@ module.exports = {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
forEachInlineChild(params, "text", forToken);
|
||||
if (includeCodeBlocks) {
|
||||
forEachInlineChild(params, "code_inline", forToken);
|
||||
|
@ -3414,7 +3433,7 @@ module.exports = rules;
|
|||
},{"../package.json":50,"./md001":5,"./md002":6,"./md003":7,"./md004":8,"./md005":9,"./md006":10,"./md007":11,"./md009":12,"./md010":13,"./md011":14,"./md012":15,"./md013":16,"./md014":17,"./md018":18,"./md019":19,"./md020":20,"./md021":21,"./md022":22,"./md023":23,"./md024":24,"./md025":25,"./md026":26,"./md027":27,"./md028":28,"./md029":29,"./md030":30,"./md031":31,"./md032":32,"./md033":33,"./md034":34,"./md035":35,"./md036":36,"./md037":37,"./md038":38,"./md039":39,"./md040":40,"./md041":41,"./md042":42,"./md043":43,"./md044":44,"./md045":45,"./md046":46,"./md047":47,"./md048":48}],50:[function(require,module,exports){
|
||||
module.exports={
|
||||
"name": "markdownlint",
|
||||
"version": "0.20.4",
|
||||
"version": "0.21.0",
|
||||
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
|
||||
"main": "lib/markdownlint.js",
|
||||
"types": "lib/markdownlint.d.ts",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "markdownlint-rule-helpers",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.0",
|
||||
"description": "A collection of markdownlint helper functions for custom rules",
|
||||
"main": "helpers.js",
|
||||
"author": "David Anson (https://dlaa.me/)",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "markdownlint",
|
||||
"version": "0.20.4",
|
||||
"version": "0.21.0",
|
||||
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
|
||||
"main": "lib/markdownlint.js",
|
||||
"types": "lib/markdownlint.d.ts",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue