File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,7 @@ module.exports = wrap;
44
55wrap . needed = needed ;
66
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' ) ;
248
259/* Wrap all inline runs of MDAST content in `paragraph` nodes. */
2610function wrap ( nodes ) {
@@ -33,7 +17,7 @@ function wrap(nodes) {
3317 while ( ++ index < length ) {
3418 node = nodes [ index ] ;
3519
36- if ( is ( inline , node ) ) {
20+ if ( phrasing ( node ) ) {
3721 if ( queue === undefined ) {
3822 queue = [ ] ;
3923 }
@@ -64,7 +48,7 @@ function needed(nodes) {
6448 var index = - 1 ;
6549
6650 while ( ++ index < length ) {
67- if ( ! is ( inline , nodes [ index ] ) ) {
51+ if ( ! phrasing ( nodes [ index ] ) ) {
6852 return true ;
6953 }
7054 }
Original file line number Diff line number Diff line change 2626 "hast-util-has-property" : " ^1.0.0" ,
2727 "hast-util-is-element" : " ^1.0.0" ,
2828 "hast-util-to-string" : " ^1.0.0" ,
29+ "mdast-util-phrasing" : " ^1.0.0" ,
2930 "rehype-minify-whitespace" : " ^2.0.3" ,
3031 "trim-trailing-lines" : " ^1.1.0" ,
31- "unist-util-is" : " ^2.1.0" ,
3232 "unist-util-visit" : " ^1.1.1" ,
3333 "xtend" : " ^4.0.1"
3434 },
You can’t perform that action at this time.
0 commit comments