Skip to content

Commit

Permalink
Update for changes in remark@4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Feb 14, 2016
1 parent 6381e62 commit 7fde792
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions doc/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,8 @@ Options: `boolean`, default: `false`.

Warn when the horizontal rules violate a given or detected style.

Note that horizontal rules are also called “thematic break”.

Options: `string`, either a valid markdown rule, or `consistent`,
default: `'consistent'`.

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-literal-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function noLiteralURLs(ast, file, preferred, done) {
if (
initial === head &&
final === tail &&
(value === node.href || value == MAILTO + node.href)
(value === node.url || value == MAILTO + node.url)
) {
file.warn('Don’t use literal URLs without angle brackets', node);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-missing-blank-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function isApplicable(node) {
'html',
'list',
'table',
'horizontalRule'
'thematicBreak'
].indexOf(node.type) !== -1;
}

Expand Down
6 changes: 4 additions & 2 deletions lib/rules/rule-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* @fileoverview
* Warn when the horizontal rules violate a given or detected style.
*
* Note that horizontal rules are also called “thematic break”.
*
* Options: `string`, either a valid markdown rule, or `consistent`,
* default: `'consistent'`.
* @example
Expand Down Expand Up @@ -71,7 +73,7 @@ function ruleStyle(ast, file, preferred, done) {
return;
}

visit(ast, 'horizontalRule', function (node) {
visit(ast, 'thematicBreak', function (node) {
var initial = start(node).offset;
var final = end(node).offset;
var hr;
Expand All @@ -84,7 +86,7 @@ function ruleStyle(ast, file, preferred, done) {

if (preferred) {
if (hr !== preferred) {
file.warn('Horizontal rules should use `' + preferred + '`', node);
file.warn('Rules should use `' + preferred + '`', node);
}
} else {
preferred = hr;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"istanbul": "^0.4.0",
"jscs": "^2.0.0",
"jscs-jsdoc": "^1.0.0",
"remark": "^3.0.0",
"remark-comment-config": "^2.0.0",
"remark-github": "^4.0.0",
"remark-toc": "^2.0.0",
"remark": "^4.0.0-alpha.4",
"remark-comment-config": "^3.0.0",
"remark-github": "^4.0.1",
"remark-toc": "^3.0.0",
"remark-validate-links": "^2.0.0",
"mocha": "^2.0.0",
"vfile": "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion script/build-rule-documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ children.push(
},
{
'type': 'link',
'href': 'https://github.com/wooorm/remark-lint#list-of-external-rules',
'url': 'https://github.com/wooorm/remark-lint#list-of-external-rules',
'children': [{
'type': 'text',
'value': 'list of external rules'
Expand Down
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,9 @@ describe('Rules', function () {

describeSetting(true, function () {
assertFile('rule-style-invalid.md', [
'rule-style-invalid.md:7:1-7:10: Horizontal rules should use `* * * *`',
'rule-style-invalid.md:11:1-11:6: Horizontal rules should use `* * * *`',
'rule-style-invalid.md:15:1-15:5: Horizontal rules should use `* * * *`'
'rule-style-invalid.md:7:1-7:10: Rules should use `* * * *`',
'rule-style-invalid.md:11:1-11:6: Rules should use `* * * *`',
'rule-style-invalid.md:15:1-15:5: Rules should use `* * * *`'
]);

assertFile('rule-style-valid.md', []);
Expand Down

0 comments on commit 7fde792

Please sign in to comment.