mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Remove maximum-line-length warnings on definitions
Closes GH-21.
This commit is contained in:
parent
7de8847b55
commit
1119ca83b7
@ -661,7 +661,7 @@ Options: `boolean`, default: `false`.
|
||||
Options: `number`, default: `80`.
|
||||
|
||||
Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
code, link, and images.
|
||||
code, link, images, and definitions.
|
||||
|
||||
### no-auto-link-without-protocol
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Options: `number`, default: `80`.
|
||||
*
|
||||
* Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
* code, link, and images.
|
||||
* code, link, images, and definitions.
|
||||
* @example
|
||||
* <!-- Valid, when set to `40` -->
|
||||
* Alpha bravo charlie delta echo.
|
||||
@ -53,10 +53,11 @@ var end = position.end;
|
||||
* @return {boolean} - Whether or not `node` should be
|
||||
* ignored.
|
||||
*/
|
||||
function isApplicable(node) {
|
||||
function isIgnored(node) {
|
||||
return node.type === 'heading' ||
|
||||
node.type === 'table' ||
|
||||
node.type === 'code';
|
||||
node.type === 'code' ||
|
||||
node.type === 'definition';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,7 +97,7 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
*/
|
||||
|
||||
visit(ast, function (node) {
|
||||
var applicable = isApplicable(node);
|
||||
var applicable = isIgnored(node);
|
||||
var initial = applicable && start(node).line;
|
||||
var final = applicable && end(node).line;
|
||||
|
||||
|
@ -2654,7 +2654,7 @@ module.exports = maximumHeadingLength;
|
||||
* Options: `number`, default: `80`.
|
||||
*
|
||||
* Ignores nodes which cannot be wrapped, such as heasings, tables,
|
||||
* code, link, and images.
|
||||
* code, link, images, and definitions.
|
||||
* @example
|
||||
* <!-- Valid, when set to `40` -->
|
||||
* Alpha bravo charlie delta echo.
|
||||
@ -2699,10 +2699,11 @@ var end = position.end;
|
||||
* @return {boolean} - Whether or not `node` should be
|
||||
* ignored.
|
||||
*/
|
||||
function isApplicable(node) {
|
||||
function isIgnored(node) {
|
||||
return node.type === 'heading' ||
|
||||
node.type === 'table' ||
|
||||
node.type === 'code';
|
||||
node.type === 'code' ||
|
||||
node.type === 'definition';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2742,7 +2743,7 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
*/
|
||||
|
||||
visit(ast, function (node) {
|
||||
var applicable = isApplicable(node);
|
||||
var applicable = isIgnored(node);
|
||||
var initial = applicable && start(node).line;
|
||||
var final = applicable && end(node).line;
|
||||
|
||||
|
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
@ -18,3 +18,7 @@ This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?qu
|
||||
The following is also fine, because there is no white-space.
|
||||
|
||||
<http://this-long-url-with-a-long-domain-is-invalid.co.uk/a-long-path?query=variables>.
|
||||
|
||||
In addition, definitions are also fine:
|
||||
|
||||
[foo]: <http://this-long-url-with-a-long-domain-is-invalid.co.uk/a-long-path?query=variables>
|
||||
|
Loading…
Reference in New Issue
Block a user