node_modules/mdast-util-to-hast/lib/footer.js
/* Transform all footnote definitions, if any. */
Transform all footnote definitions, if any.
Transform all footnote definitions if any .
function generateFootnotes(h) {
  var footnotes = h.footnotes;
  var length = footnotes.length;
  var index = -1;
  var listItems = [];
  var def;
  if (!length) {
    return null;
  }
  while (++index < length) {
    def = footnotes[index];
    listItems[index] = {
      type: 'listItem',
      data: {hProperties: {id: 'fn-' + def.identifier}},
      children: def.children.concat({
        type: 'link',
        url: '#fnref-' + def.identifier,
        data: {hProperties: {className: ['footnote-backref']}},
        children: [{
          type: 'text',
          value: '↩'
        }]
      }),
      position: def.position
    };
  }
  return h(null, 'div', {
    className: ['footnotes']
  }, wrap([
    thematicBreak(h),
    list(h, {
      type: 'list',
      ordered: true,
      children: listItems
    })
  ], true));
}
function generateFootnotes ( h ) { var footnotes = h . footnotes ; var length = footnotes . length ; var index = - 1 ; var listItems = [ ] ; var def ; if ( ! length ) { return null ; } while ( ++ index < length ) { def = footnotes [ index ] ; listItems [ index ] = { type : 'listItem' , data : { hProperties : { id : 'fn-' + def . identifier } } , children : def . children . concat ( { type : 'link' , url : '#fnref-' + def . identifier , data : { hProperties : { className : [ 'footnote-backref' ] } } , children : [ { type : 'text' , value : '↩' } ] } ) , position : def . position } ; } return h ( null , 'div' , { className : [ 'footnotes' ] } , wrap ( [ thematicBreak ( h ) , list ( h , { type : 'list' , ordered : true , children : listItems } ) ] , true ) ) ; }
Transform all footnote definitions, if any.
Transform all footnote definitions if any .