Skip to content

Commit 57f7e51

Browse files
committed
Update micromark
1 parent d62c49a commit 57f7e51

File tree

5 files changed

+13
-18
lines changed

5 files changed

+13
-18
lines changed

index.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ var codes = require('micromark/dist/character/codes')
88
var constants = require('micromark/dist/constant/constants')
99
var own = require('micromark/dist/constant/has-own-property')
1010
var types = require('micromark/dist/constant/types')
11-
var flatMap = require('micromark/dist/util/flat-map')
1211
var normalizeIdentifier = require('micromark/dist/util/normalize-identifier')
1312
var safeFromInt = require('micromark/dist/util/safe-from-int')
1413
var parser = require('micromark/dist/parse')
1514
var preprocessor = require('micromark/dist/preprocess')
16-
var postprocessor = require('micromark/dist/postprocess')
15+
var postprocess = require('micromark/dist/postprocess')
1716

1817
function fromMarkdown(value, encoding, options) {
1918
if (typeof encoding !== 'string') {
@@ -22,11 +21,8 @@ function fromMarkdown(value, encoding, options) {
2221
}
2322

2423
return compiler(options)(
25-
postprocessor()(
26-
flatMap(
27-
flatMap([value, codes.eof], preprocessor(), encoding),
28-
parser(options).document().write
29-
)
24+
postprocess(
25+
parser(options).document().write(preprocessor()(value, encoding, true))
3026
)
3127
)
3228
}
@@ -155,8 +151,6 @@ function compiler(options) {
155151
while (++index < events.length) {
156152
event = events[index]
157153

158-
if (!event) break
159-
160154
// We preprocess lists to add `listItem` tokens, and to infer whether
161155
// items the list itself are spread out.
162156
if (
@@ -173,7 +167,7 @@ function compiler(options) {
173167
}
174168

175169
index = -1
176-
length = events.length - 1
170+
length = events.length
177171

178172
while (++index < length) {
179173
handler = config[events[index][0]]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"dependencies": {
3333
"mdast-util-to-string": "^1.0.0",
34-
"micromark": "~2.8.0",
34+
"micromark": "~2.9.0",
3535
"parse-entities": "^2.0.0"
3636
},
3737
"devDependencies": {

test/fixtures/blockquote.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@
233233
"offset": 111
234234
},
235235
"end": {
236-
"line": 12,
237-
"column": 29,
238-
"offset": 143
236+
"line": 13,
237+
"column": 1,
238+
"offset": 144
239239
}
240240
}
241241
}
@@ -247,9 +247,9 @@
247247
"offset": 95
248248
},
249249
"end": {
250-
"line": 12,
251-
"column": 29,
252-
"offset": 143
250+
"line": 13,
251+
"column": 1,
252+
"offset": 144
253253
}
254254
}
255255
},

test/fixtures/definition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"type": "definition",
120120
"identifier": "a",
121121
"label": "a",
122-
"title": "\nc d\n e",
122+
"title": "\nc d\ne",
123123
"url": "b",
124124
"position": {
125125
"start": {

test/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ test('fixtures', function (t) {
824824
// These are different (in a good way) from remark.
825825
var fixesRemark = [
826826
'attention',
827+
'blockquote',
827828
'code-indented',
828829
'definition',
829830
'hard-break-escape',

0 commit comments

Comments
 (0)