@@ -8,65 +8,6 @@ import {toHast} from '../index.js'
88
99test ( 'footnote' , async function ( t ) {
1010 await t . test ( 'should render `footnote`s (#1)' , async function ( ) {
11- const tree = toHast ( {
12- type : 'root' ,
13- // @ts -expect-error: to do: remove `footnote`s.
14- children : [ { type : 'footnote' , children : [ { type : 'text' , value : 'alpha' } ] } ]
15- } )
16- assert ( tree , 'expected node' )
17- assert . equal (
18- // @ts -expect-error: to do: remove when `to-html` is released.
19- toHtml ( tree ) ,
20- `<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref aria-describedby="footnote-label">1</a></sup>
21- <section data-footnotes class="footnotes"><h2 class="sr-only" id="footnote-label">Footnotes</h2>
22- <ol>
23- <li id="user-content-fn-1">
24- <p>alpha <a href="#user-content-fnref-1" data-footnote-backref class="data-footnote-backref" aria-label="Back to content">↩</a></p>
25- </li>
26- </ol>
27- </section>`
28- )
29- } )
30-
31- await t . test ( 'should render `footnote`s (#2)' , async function ( ) {
32- const tree = toHast ( {
33- type : 'root' ,
34- children : [
35- {
36- type : 'footnoteDefinition' ,
37- identifier : '1' ,
38- children : [
39- { type : 'paragraph' , children : [ { type : 'text' , value : 'bravo' } ] }
40- ]
41- } ,
42- {
43- type : 'paragraph' ,
44- children : [ { type : 'footnoteReference' , identifier : '1' } ]
45- } ,
46- // @ts -expect-error: to do: remove `footnote`s.
47- { type : 'footnote' , children : [ { type : 'text' , value : 'charlie' } ] }
48- ]
49- } )
50- assert ( tree , 'expected node' )
51- assert . equal (
52- // @ts -expect-error: to do: remove when `to-html` is released.
53- toHtml ( tree ) ,
54- `<p><sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref aria-describedby="footnote-label">1</a></sup></p>
55- <sup><a href="#user-content-fn-2" id="user-content-fnref-2" data-footnote-ref aria-describedby="footnote-label">2</a></sup>
56- <section data-footnotes class="footnotes"><h2 class="sr-only" id="footnote-label">Footnotes</h2>
57- <ol>
58- <li id="user-content-fn-1">
59- <p>bravo <a href="#user-content-fnref-1" data-footnote-backref class="data-footnote-backref" aria-label="Back to content">↩</a></p>
60- </li>
61- <li id="user-content-fn-2">
62- <p>charlie <a href="#user-content-fnref-2" data-footnote-backref class="data-footnote-backref" aria-label="Back to content">↩</a></p>
63- </li>
64- </ol>
65- </section>`
66- )
67- } )
68-
69- await t . test ( 'should render `footnote`s (#3)' , async function ( ) {
7011 const tree = toHast ( {
7112 type : 'root' ,
7213 children : [
0 commit comments