Skip to content

Commit 45f9310

Browse files
committed
Update dev-dependencies
1 parent 68581fc commit 45f9310

File tree

2 files changed

+6
-62
lines changed

2 files changed

+6
-62
lines changed

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"prettier": "^2.0.0",
4949
"rehype-parse": "^7.0.0",
5050
"rehype-stringify": "^8.0.0",
51-
"remark-cli": "^8.0.0",
52-
"remark-preset-wooorm": "^7.0.0",
51+
"remark-cli": "^9.0.0-alpha.1",
52+
"remark-preset-wooorm": "^8.0.0",
5353
"tape": "^5.0.0",
5454
"tinyify": "^3.0.0",
5555
"unified": "^9.0.0",
@@ -89,7 +89,10 @@
8989
"unicorn/prefer-number-properties": "off",
9090
"unicorn/prefer-optional-catch-binding": "off",
9191
"unicorn/prefer-set-has": "off"
92-
}
92+
},
93+
"ignores": [
94+
"types/"
95+
]
9396
},
9497
"remarkConfig": {
9598
"plugins": [

test/index.js

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ var fs = require('fs')
44
var path = require('path')
55
var test = require('tape')
66
var unified = require('unified')
7-
var remarkParse = require('remark-parse')
87
var rehypeParse = require('rehype-parse')
98
var rehypeStringify = require('rehype-stringify')
10-
var visit = require('unist-util-visit')
119
var toHast = require('mdast-util-to-hast')
1210
var toHtml = require('hast-util-to-html')
1311
var commonmark = require('commonmark.json')
@@ -821,24 +819,6 @@ test('mdast-util-from-markdown', function (t) {
821819
test('fixtures', function (t) {
822820
var base = join('test', 'fixtures')
823821

824-
// These are different (in a good way) from remark.
825-
var fixesRemark = [
826-
'attention',
827-
'blockquote',
828-
'character-references-everywhere',
829-
'code-indented',
830-
'definition',
831-
'hard-break-escape',
832-
'hard-break-prefix',
833-
'heading-setext',
834-
'html-text',
835-
'image-reference',
836-
'image-resource',
837-
'link-reference',
838-
'link-resource',
839-
'list'
840-
]
841-
842822
fs.readdirSync(base)
843823
.filter((d) => path.extname(d) === '.md')
844824
.forEach((d) => each(path.basename(d, path.extname(d))))
@@ -849,7 +829,6 @@ test('fixtures', function (t) {
849829
var fp = join(base, stem + '.json')
850830
var doc = fs.readFileSync(join(base, stem + '.md'))
851831
var actual = fromMarkdown(doc)
852-
var remarkTree = remarkLegacyParse(String(doc))
853832
var expected
854833

855834
try {
@@ -861,10 +840,6 @@ test('fixtures', function (t) {
861840
}
862841

863842
t.deepEqual(actual, expected, stem)
864-
865-
if (fixesRemark.includes(stem)) return
866-
867-
t.deepEqual(actual, remarkTree, stem + ' (remark)')
868843
}
869844
})
870845

@@ -896,37 +871,3 @@ test('commonmark', function (t) {
896871
t.equal(actual, expected, example.section + ' (' + index + ')')
897872
}
898873
})
899-
900-
function remarkLegacyParse(doc) {
901-
var processor = unified().use(remarkParse, {commonmark: true}).use(clean)
902-
return processor.runSync(processor.parse(doc))
903-
}
904-
905-
function clean() {
906-
return transform
907-
908-
function transform(tree) {
909-
visit(tree, (node, index, parent) => {
910-
var siblings = parent ? parent.children : []
911-
var previous = siblings[index - 1]
912-
913-
// Drop don’t do indent anymore.
914-
delete node.position.indent
915-
916-
// Collapse text nodes.
917-
if (previous && node.type === previous.type && node.type === 'text') {
918-
previous.value += node.value
919-
920-
siblings.splice(index, 1)
921-
922-
if (previous.position && node.position) {
923-
previous.position.end = node.position.end
924-
}
925-
926-
return index
927-
}
928-
})
929-
930-
return JSON.parse(JSON.stringify(tree))
931-
}
932-
}

0 commit comments

Comments
 (0)