Skip to content

Commit ed96d00

Browse files
committed
Update mdast to remark
1 parent 0b75382 commit ed96d00

File tree

13 files changed

+521
-290
lines changed

13 files changed

+521
-290
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.{json,html,svg,css,mdastrc,eslintrc}]
11+
[*.{json,html,svg,css,remarkrc,eslintrc}]
1212
indent_size = 2
1313

1414
[*.md]
File renamed without changes.

.mdastrc renamed to .remarkrc

File renamed without changes.

component.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "MIT",
66
"keywords": [
77
"mdast",
8+
"remark",
89
"nlcst",
910
"markdown",
1011
"natural",

history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--mdast setext-->
1+
<!--remark setext-->
22

33
<!--lint disable no-multiple-toplevel-headings-->
44

mdast-util-to-nlcst.js

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function toNLCST(file, Parser) {
280280

281281
module.exports = toNLCST;
282282

283-
},{"mdast-range":2,"nlcst-to-string":4}],2:[function(require,module,exports){
283+
},{"mdast-range":2,"nlcst-to-string":3}],2:[function(require,module,exports){
284284
/**
285285
* @author Titus Wormer
286286
* @copyright 2015 Titus Wormer
@@ -460,7 +460,66 @@ function attacher() {
460460

461461
module.exports = attacher;
462462

463-
},{"unist-util-visit":3}],3:[function(require,module,exports){
463+
},{"unist-util-visit":4}],3:[function(require,module,exports){
464+
/**
465+
* @author Titus Wormer
466+
* @copyright 2014-2015 Titus Wormer
467+
* @license MIT
468+
* @module nlcst:to-string
469+
* @fileoverview Transform an NLCST node into a string.
470+
*/
471+
472+
'use strict';
473+
474+
/* eslint-env commonjs */
475+
476+
/**
477+
* Stringify an NLCST node.
478+
*
479+
* @param {NLCSTNode|Array.<NLCSTNode>} node - Node to to
480+
* stringify.
481+
* @param {string} separator - Value to separate each item
482+
* with.
483+
* @return {string} - Stringified `node`.
484+
*/
485+
function nlcstToString(node, separator) {
486+
var values;
487+
var length;
488+
var children;
489+
490+
separator = separator || '';
491+
492+
if (typeof node.value === 'string') {
493+
return node.value;
494+
}
495+
496+
children = 'length' in node ? node : node.children;
497+
length = children.length;
498+
499+
/*
500+
* Shortcut: This is pretty common, and a small performance win.
501+
*/
502+
503+
if (length === 1 && 'value' in children[0]) {
504+
return children[0].value;
505+
}
506+
507+
values = [];
508+
509+
while (length--) {
510+
values[length] = nlcstToString(children[length], separator);
511+
}
512+
513+
return values.join(separator);
514+
}
515+
516+
/*
517+
* Expose.
518+
*/
519+
520+
module.exports = nlcstToString;
521+
522+
},{}],4:[function(require,module,exports){
464523
/**
465524
* @author Titus Wormer
466525
* @copyright 2015 Titus Wormer. All rights reserved.
@@ -575,60 +634,5 @@ function visit(tree, type, callback, reverse) {
575634

576635
module.exports = visit;
577636

578-
},{}],4:[function(require,module,exports){
579-
/**
580-
* @author Titus Wormer
581-
* @copyright 2014-2015 Titus Wormer
582-
* @license MIT
583-
* @module nlcst:to-string
584-
* @fileoverview Transform an NLCST node into a string.
585-
*/
586-
587-
'use strict';
588-
589-
/* eslint-env commonjs */
590-
591-
/**
592-
* Stringify an NLCST node.
593-
*
594-
* @param {NLCSTNode|Array.<NLCSTNode>} node - Node to to
595-
* stringify.
596-
* @return {string} - Stringified `node`.
597-
*/
598-
function nlcstToString(node) {
599-
var values;
600-
var length;
601-
var children;
602-
603-
if (typeof node.value === 'string') {
604-
return node.value;
605-
}
606-
607-
children = 'length' in node ? node : node.children;
608-
length = children.length;
609-
610-
/*
611-
* Shortcut: This is pretty common, and a small performance win.
612-
*/
613-
614-
if (length === 1 && 'value' in children[0]) {
615-
return children[0].value;
616-
}
617-
618-
values = [];
619-
620-
while (length--) {
621-
values[length] = nlcstToString(children[length]);
622-
}
623-
624-
return values.join('');
625-
}
626-
627-
/*
628-
* Expose.
629-
*/
630-
631-
module.exports = nlcstToString;
632-
633637
},{}]},{},[1])(1)
634638
});

mdast-util-to-nlcst.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "MIT",
66
"keywords": [
77
"mdast",
8+
"remark",
89
"nlcst",
910
"markdown",
1011
"natural",
@@ -33,16 +34,17 @@
3334
"istanbul": "^0.3.0",
3435
"jscs": "^2.0.0",
3536
"jscs-jsdoc": "^1.0.0",
36-
"mdast": "^1.0.0",
37-
"mdast-comment-config": "^1.0.0",
38-
"mdast-github": "^1.0.0",
39-
"mdast-lint": "^1.0.0",
40-
"mdast-slug": "^2.0.0",
41-
"mdast-validate-links": "^1.0.0",
4237
"mocha": "^2.0.0",
4338
"parse-dutch": "^2.0.0",
4439
"parse-english": "^2.0.0",
4540
"parse-latin": "^2.0.0",
41+
"remark": "^3.0.0",
42+
"remark-comment-config": "^2.0.0",
43+
"remark-github": "^2.0.0",
44+
"remark-lint": "^2.0.0",
45+
"remark-slug": "^3.0.0",
46+
"remark-validate-links": "^2.0.0",
47+
"retext": "^1.0.0",
4648
"vfile": "^1.0.0"
4749
},
4850
"scripts": {
@@ -57,7 +59,7 @@
5759
"make": "npm run lint && npm run test-coverage",
5860
"bundle": "browserify index.js --no-builtins -s mdastUtilToNLCST > mdast-util-to-nlcst.js",
5961
"postbundle": "esmangle mdast-util-to-nlcst.js > mdast-util-to-nlcst.min.js",
60-
"build-md": "mdast . --quiet",
62+
"build-md": "remark . --quiet --frail",
6163
"build": "npm run bundle && npm run build-md"
6264
}
6365
}

0 commit comments

Comments
 (0)