mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-10-26 19:31:42 +03:00
Add images to blacklist for maximum-line-length
This commit is contained in:
parent
3f6344c730
commit
ba6d270772
@ -598,7 +598,7 @@ Options: `boolean`, default: `false`.
|
||||
Options: `number`, default: `80`.
|
||||
|
||||
Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
code, and links.
|
||||
code, link, and images.
|
||||
|
||||
### no-auto-link-without-protocol
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Options: `number`, default: `80`.
|
||||
*
|
||||
* Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
* code, and links.
|
||||
* code, link, and images.
|
||||
* @example
|
||||
* <!-- Valid, when set to `40` -->
|
||||
* Alpha bravo charlie delta echo.
|
||||
@ -113,8 +113,7 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
* there’s white-space after it, they are not
|
||||
* whitelisted.
|
||||
*/
|
||||
|
||||
visit(ast, 'link', function (node, pos, parent) {
|
||||
function validateLink(node, pos, parent) {
|
||||
var next = parent.children[pos + 1];
|
||||
var initial = start(node);
|
||||
var final = end(node);
|
||||
@ -150,7 +149,10 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
}
|
||||
|
||||
whitelist(initial.line - 1, final.line);
|
||||
});
|
||||
}
|
||||
|
||||
visit(ast, 'link', validateLink);
|
||||
visit(ast, 'image', validateLink);
|
||||
|
||||
/*
|
||||
* Iterate over every line, and warn for
|
||||
|
@ -2302,7 +2302,7 @@ module.exports = maximumHeadingLength;
|
||||
* Options: `number`, default: `80`.
|
||||
*
|
||||
* Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
* code, and links.
|
||||
* code, link, and images.
|
||||
* @example
|
||||
* <!-- Valid, when set to `40` -->
|
||||
* Alpha bravo charlie delta echo.
|
||||
@ -2407,8 +2407,7 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
* there’s white-space after it, they are not
|
||||
* whitelisted.
|
||||
*/
|
||||
|
||||
visit(ast, 'link', function (node, pos, parent) {
|
||||
function validateLink(node, pos, parent) {
|
||||
var next = parent.children[pos + 1];
|
||||
var initial = start(node);
|
||||
var final = end(node);
|
||||
@ -2444,7 +2443,10 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
}
|
||||
|
||||
whitelist(initial.line - 1, final.line);
|
||||
});
|
||||
}
|
||||
|
||||
visit(ast, 'link', validateLink);
|
||||
visit(ast, 'image', validateLink);
|
||||
|
||||
/*
|
||||
* Iterate over every line, and warn for
|
||||
|
2
mdast-lint.min.js
vendored
2
mdast-lint.min.js
vendored
File diff suppressed because one or more lines are too long
4
test/fixtures/maximum-line-length-valid.md
vendored
4
test/fixtures/maximum-line-length-valid.md
vendored
@ -5,8 +5,12 @@ This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?qu
|
||||
|
||||
<http://this-link-is-fine.com>
|
||||
|
||||
[foo](http://this-long-url-with-a-long-domain-is-valid.co.uk/a-long-path?query=variables)
|
||||
|
||||
<http://this-long-url-with-a-long-domain-is-valid.co.uk/a-long-path?query=variables>
|
||||
|
||||
![foo](http://this-long-url-with-a-long-domain-is-valid.co.uk/a-long-path?query=variables)
|
||||
|
||||
| An | exception | is | line | length | in | long | tables | because | those | can’t | just |
|
||||
| -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- |
|
||||
| be | helped | | | | | | | | | | . |
|
||||
|
Loading…
Reference in New Issue
Block a user