@@ -15,5 +15,33 @@ test('Definition', function (t) {
1515 'should ignore `definition`'
1616 ) ;
1717
18+ t . deepEqual (
19+ to ( u ( 'paragraph' , [
20+ u ( 'linkReference' , { identifier : 'alpha' } , [ u ( 'text' , 'bravo' ) ] ) ,
21+ u ( 'definition' , { identifier : 'alpha' , url : 'http://charlie.com' } ) ,
22+ u ( 'definition' , { identifier : 'alpha' , url : 'http://delta.com' } )
23+ ] ) ) ,
24+ u ( 'element' , { tagName : 'p' , properties : { } } , [
25+ u ( 'element' , { tagName : 'a' , properties : { href : 'http://delta.com' } } , [
26+ u ( 'text' , 'bravo' )
27+ ] )
28+ ] ) ,
29+ 'should prefer the last definition by default'
30+ ) ;
31+
32+ t . deepEqual (
33+ to ( u ( 'paragraph' , [
34+ u ( 'linkReference' , { identifier : 'alpha' } , [ u ( 'text' , 'bravo' ) ] ) ,
35+ u ( 'definition' , { identifier : 'alpha' , url : 'http://charlie.com' } ) ,
36+ u ( 'definition' , { identifier : 'alpha' , url : 'http://delta.com' } )
37+ ] ) , { commonmark : true } ) ,
38+ u ( 'element' , { tagName : 'p' , properties : { } } , [
39+ u ( 'element' , { tagName : 'a' , properties : { href : 'http://charlie.com' } } , [
40+ u ( 'text' , 'bravo' )
41+ ] )
42+ ] ) ,
43+ 'should prefer the first definition in commonmark mode'
44+ ) ;
45+
1846 t . end ( ) ;
1947} ) ;
0 commit comments