@@ -4,16 +4,17 @@ var test = require('tape')
44var unified = require ( 'unified' )
55var remarkParse = require ( 'remark-parse' )
66var remarkAttr = require ( 'remark-attr' )
7+ var remarkFootnotes = require ( 'remark-footnotes' )
78var u = require ( 'unist-builder' )
89var toc = require ( '..' )
910
1011var join = path . join
1112
12- test ( 'mdast-util-toc' , function ( t ) {
13+ test ( 'mdast-util-toc' , function ( t ) {
1314 t . is ( typeof toc , 'function' , 'should be a function' )
1415
1516 t . throws (
16- function ( ) {
17+ function ( ) {
1718 toc ( )
1819 } ,
1920 "Cannot read property 'children' of undefined" ,
@@ -23,14 +24,14 @@ test('mdast-util-toc', function(t) {
2324 t . end ( )
2425} )
2526
26- test ( 'Fixtures' , function ( t ) {
27+ test ( 'Fixtures' , function ( t ) {
2728 var root = join ( __dirname , 'fixtures' )
2829
2930 fs . readdirSync ( root )
30- . filter ( function ( filepath ) {
31+ . filter ( function ( filepath ) {
3132 return filepath . indexOf ( '.' ) !== 0
3233 } )
33- . forEach ( function ( name ) {
34+ . forEach ( function ( name ) {
3435 var input = fs . readFileSync ( join ( root , name , 'input.md' ) )
3536 var output = fs . readFileSync ( join ( root , name , 'output.json' ) )
3637 var config = { }
@@ -42,7 +43,11 @@ test('Fixtures', function(t) {
4243 config = JSON . parse ( fs . readFileSync ( join ( root , name , 'config.json' ) ) )
4344 } catch ( _ ) { }
4445
45- processor . use ( remarkParse , config . remarkParseOptions )
46+ processor . use ( remarkParse )
47+
48+ if ( config . useRemarkFootnotes ) {
49+ processor . use ( remarkFootnotes , { inlineNotes : true } )
50+ }
4651
4752 if ( config . useRemarkAttr ) {
4853 processor . use ( remarkAttr )
@@ -56,7 +61,7 @@ test('Fixtures', function(t) {
5661 t . end ( )
5762} )
5863
59- test ( 'processing nodes' , function ( t ) {
64+ test ( 'processing nodes' , function ( t ) {
6065 var rootNode = u ( 'root' , [
6166 u ( 'heading' , { depth : 1 } , [ u ( 'text' , 'Alpha' ) ] ) ,
6267 u ( 'heading' , { depth : 2 } , [ u ( 'text' , 'Bravo' ) ] )
0 commit comments