File tree 2 files changed +4
-20
lines changed
2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,7 @@ module.exports = wrap;
4
4
5
5
wrap . needed = needed ;
6
6
7
- var is = require ( 'unist-util-is' ) ;
8
-
9
- /* https://github.com/syntax-tree/mdast */
10
- var inline = [
11
- 'inlineCode' ,
12
- 'emphasis' ,
13
- 'break' ,
14
- 'strong' ,
15
- 'delete' ,
16
- 'link' ,
17
- 'image' ,
18
- 'footnote' ,
19
- 'linkReference' ,
20
- 'imageReference' ,
21
- 'footnoteReference' ,
22
- 'text'
23
- ] ;
7
+ var phrasing = require ( 'mdast-util-phrasing' ) ;
24
8
25
9
/* Wrap all inline runs of MDAST content in `paragraph` nodes. */
26
10
function wrap ( nodes ) {
@@ -33,7 +17,7 @@ function wrap(nodes) {
33
17
while ( ++ index < length ) {
34
18
node = nodes [ index ] ;
35
19
36
- if ( is ( inline , node ) ) {
20
+ if ( phrasing ( node ) ) {
37
21
if ( queue === undefined ) {
38
22
queue = [ ] ;
39
23
}
@@ -64,7 +48,7 @@ function needed(nodes) {
64
48
var index = - 1 ;
65
49
66
50
while ( ++ index < length ) {
67
- if ( ! is ( inline , nodes [ index ] ) ) {
51
+ if ( ! phrasing ( nodes [ index ] ) ) {
68
52
return true ;
69
53
}
70
54
}
Original file line number Diff line number Diff line change 26
26
"hast-util-has-property" : " ^1.0.0" ,
27
27
"hast-util-is-element" : " ^1.0.0" ,
28
28
"hast-util-to-string" : " ^1.0.0" ,
29
+ "mdast-util-phrasing" : " ^1.0.0" ,
29
30
"rehype-minify-whitespace" : " ^2.0.3" ,
30
31
"trim-trailing-lines" : " ^1.1.0" ,
31
- "unist-util-is" : " ^2.1.0" ,
32
32
"unist-util-visit" : " ^1.1.1" ,
33
33
"xtend" : " ^4.0.1"
34
34
},
You can’t perform that action at this time.
0 commit comments