markdownlint 0.26.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/demo/markdownlint-browser.js +8 -5
- package/helpers/helpers.js +1 -1
- package/helpers/package.json +3 -2
- package/lib/constants.js +1 -1
- package/lib/md051.js +5 -2
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1019,6 +1019,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
|
1019
1019
|
remove support for end-of-life Node version 12, default `resultVersion` to 3, update
|
|
1020
1020
|
browser script to use ES2015, simplify JSON schema, address remaining CodeQL issues,
|
|
1021
1021
|
improve performance, update dependencies.
|
|
1022
|
+
* 0.26.1 - Improve MD051.
|
|
1022
1023
|
|
|
1023
1024
|
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
1024
1025
|
[npm-url]: https://www.npmjs.com/package/markdownlint
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markdownlint 0.26.
|
|
1
|
+
/*! markdownlint 0.26.1 https://github.com/DavidAnson/markdownlint @license MIT */
|
|
2
2
|
var markdownlint;
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ var __webpack_modules__ = ({
|
|
@@ -1077,7 +1077,7 @@ module.exports.getNextChildToken = getNextChildToken;
|
|
|
1077
1077
|
* @returns {string} Absolute path (or original path).
|
|
1078
1078
|
*/
|
|
1079
1079
|
function expandTildePath(file, os) {
|
|
1080
|
-
const homedir = os && os.homedir();
|
|
1080
|
+
const homedir = os && os.homedir && os.homedir();
|
|
1081
1081
|
return homedir ? file.replace(/^~($|\/|\\)/, `${homedir}$1`) : file;
|
|
1082
1082
|
}
|
|
1083
1083
|
module.exports.expandTildePath = expandTildePath;
|
|
@@ -1187,7 +1187,7 @@ module.exports.referenceLinkImageData =
|
|
|
1187
1187
|
|
|
1188
1188
|
module.exports.deprecatedRuleNames = ["MD002", "MD006"];
|
|
1189
1189
|
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
|
1190
|
-
module.exports.version = "0.26.
|
|
1190
|
+
module.exports.version = "0.26.1";
|
|
1191
1191
|
|
|
1192
1192
|
|
|
1193
1193
|
/***/ }),
|
|
@@ -4610,7 +4610,10 @@ const identifierRe = /(?:id|name)\s*=\s*['"]?([^'"\s>]+)/iu;
|
|
|
4610
4610
|
* @returns {string} Fragment string for heading.
|
|
4611
4611
|
*/
|
|
4612
4612
|
function convertHeadingToHTMLFragment(inline) {
|
|
4613
|
-
const inlineText = inline.children
|
|
4613
|
+
const inlineText = inline.children
|
|
4614
|
+
.filter((token) => token.type !== "html_inline")
|
|
4615
|
+
.map((token) => token.content)
|
|
4616
|
+
.join("");
|
|
4614
4617
|
return "#" + encodeURIComponent(inlineText
|
|
4615
4618
|
.toLowerCase()
|
|
4616
4619
|
// RegExp source with Ruby's \p{Word} expanded into its General Categories
|
|
@@ -4663,7 +4666,7 @@ module.exports = {
|
|
|
4663
4666
|
context = match[0];
|
|
4664
4667
|
range = [match.index + 1, match[0].length];
|
|
4665
4668
|
}
|
|
4666
|
-
addError(onError, lineNumber,
|
|
4669
|
+
addError(onError, lineNumber, undefined, context, range);
|
|
4667
4670
|
}
|
|
4668
4671
|
});
|
|
4669
4672
|
}
|
package/helpers/helpers.js
CHANGED
|
@@ -1126,7 +1126,7 @@ module.exports.getNextChildToken = getNextChildToken;
|
|
|
1126
1126
|
* @returns {string} Absolute path (or original path).
|
|
1127
1127
|
*/
|
|
1128
1128
|
function expandTildePath(file, os) {
|
|
1129
|
-
const homedir = os && os.homedir();
|
|
1129
|
+
const homedir = os && os.homedir && os.homedir();
|
|
1130
1130
|
return homedir ? file.replace(/^~($|\/|\\)/, `${homedir}$1`) : file;
|
|
1131
1131
|
}
|
|
1132
1132
|
module.exports.expandTildePath = expandTildePath;
|
package/helpers/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-rule-helpers",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "A collection of markdownlint helper functions for custom rules",
|
|
5
|
-
"main": "helpers.js",
|
|
5
|
+
"main": "./helpers.js",
|
|
6
|
+
"exports": "./helpers.js",
|
|
6
7
|
"author": "David Anson (https://dlaa.me/)",
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"homepage": "https://github.com/DavidAnson/markdownlint",
|
package/lib/constants.js
CHANGED
package/lib/md051.js
CHANGED
|
@@ -16,7 +16,10 @@ const identifierRe = /(?:id|name)\s*=\s*['"]?([^'"\s>]+)/iu;
|
|
|
16
16
|
* @returns {string} Fragment string for heading.
|
|
17
17
|
*/
|
|
18
18
|
function convertHeadingToHTMLFragment(inline) {
|
|
19
|
-
const inlineText = inline.children
|
|
19
|
+
const inlineText = inline.children
|
|
20
|
+
.filter((token) => token.type !== "html_inline")
|
|
21
|
+
.map((token) => token.content)
|
|
22
|
+
.join("");
|
|
20
23
|
return "#" + encodeURIComponent(
|
|
21
24
|
inlineText
|
|
22
25
|
.toLowerCase()
|
|
@@ -77,7 +80,7 @@ module.exports = {
|
|
|
77
80
|
context = match[0];
|
|
78
81
|
range = [ match.index + 1, match[0].length ];
|
|
79
82
|
}
|
|
80
|
-
addError(onError, lineNumber,
|
|
83
|
+
addError(onError, lineNumber, undefined, context, range);
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
86
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
|
|
5
5
|
"type": "commonjs",
|
|
6
|
-
"main": "lib/markdownlint.js",
|
|
7
|
-
"
|
|
6
|
+
"main": "./lib/markdownlint.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/markdownlint.js",
|
|
9
|
+
"./helpers": "./helpers/helpers.js"
|
|
10
|
+
},
|
|
11
|
+
"types": "./lib/markdownlint.d.ts",
|
|
8
12
|
"author": "David Anson (https://dlaa.me/)",
|
|
9
13
|
"license": "MIT",
|
|
10
14
|
"homepage": "https://github.com/DavidAnson/markdownlint",
|