Skip to content

Commit 861125e

Browse files
committed
Update for changes in remark
1 parent 6737b1c commit 861125e

File tree

9 files changed

+33
-31
lines changed

9 files changed

+33
-31
lines changed

lib/handlers/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ function code(h, node) {
4343
}
4444
}
4545

46-
return h(node, 'code', {lang: lang || null}, trim(toString(node)))
46+
return h(node, 'code', {lang: lang || null, meta: null}, trim(toString(node)))
4747
}

lib/handlers/data-list.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = dataList
44

55
var is = require('hast-util-is-element')
66
var wrapListItems = require('../util/wrap-list-items')
7-
var loose = require('../util/list-loose')
7+
var spread = require('../util/list-items-spread')
88

99
function dataList(h, node) {
1010
var children = node.children
@@ -55,7 +55,7 @@ function dataList(h, node) {
5555
if (group.length !== 0) {
5656
content.push({
5757
type: 'listItem',
58-
loose: group.length > 1,
58+
spread: group.length > 1,
5959
checked: null,
6060
children: group
6161
})
@@ -67,7 +67,7 @@ function dataList(h, node) {
6767
return h(
6868
node,
6969
'list',
70-
{ordered: false, start: null, loose: loose(content)},
70+
{ordered: false, start: null, spread: spread(content)},
7171
content
7272
)
7373
}
@@ -89,7 +89,7 @@ function handle(h, category) {
8989
type: 'list',
9090
ordered: false,
9191
start: null,
92-
loose: loose(nodes),
92+
spread: spread(nodes),
9393
children: nodes
9494
}
9595
]

lib/handlers/list-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function listItem(h, node) {
5656
return h(
5757
node,
5858
'listItem',
59-
{loose: content.length > 1, checked: checked},
59+
{spread: content.length > 1, checked: checked},
6060
content
6161
)
6262
}

lib/handlers/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = list
44

55
var has = require('hast-util-has-property')
66
var wrapListItems = require('../util/wrap-list-items')
7-
var loose = require('../util/list-loose')
7+
var spread = require('../util/list-items-spread')
88

99
function list(h, node) {
1010
var ordered = node.tagName === 'ol'
@@ -20,7 +20,7 @@ function list(h, node) {
2020
return h(
2121
node,
2222
'list',
23-
{ordered: ordered, start: start, loose: loose(children)},
23+
{ordered: ordered, start: start, spread: spread(children)},
2424
children
2525
)
2626
}

lib/util/list-items-spread.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict'
2+
3+
module.exports = spread
4+
5+
function spread(children) {
6+
var length = children.length
7+
var index = -1
8+
9+
if (length > 1) {
10+
while (++index < length) {
11+
if (children[index].spread) {
12+
return true
13+
}
14+
}
15+
}
16+
17+
return false
18+
}

lib/util/list-loose.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/util/wrap-list-items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function wrapped(h, node) {
1616
if (child.type !== 'listItem') {
1717
children[index] = {
1818
type: 'listItem',
19-
loose: false,
19+
spread: false,
2020
checked: null,
2121
children: [child]
2222
}

test/fixtures/ol/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ Bar.
2626

2727
Baz.
2828

29-
1.··
29+
1.
3030
2. Something else
3131

3232
Qux.
3333

3434
1. Something else
35-
2.··
35+
2.
3636

3737
Quux.
3838

3939
1. Something else
40-
2.··
40+
2.
4141

4242
Quuux.
4343

test/fixtures/ul/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ Bar.
2626

2727
Baz.
2828

29-
-···
29+
-
3030
- Something else
3131

3232
Qux.
3333

3434
- Something else
35-
-···
35+
-
3636

3737
Quux.
3838

3939
- Something else
40-
-···
40+
-
4141

4242
Quuux.
4343

0 commit comments

Comments
 (0)