planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

61
node_modules/mdast-util-to-hast/lib/footer.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
'use strict'
module.exports = generateFootnotes
var thematicBreak = require('./handlers/thematic-break')
var list = require('./handlers/list')
var wrap = require('./wrap')
function generateFootnotes(h) {
var footnotes = h.footnotes
var length = footnotes.length
var index = -1
var listItems = []
var def
var backReference
var content
var tail
if (!length) {
return null
}
while (++index < length) {
def = footnotes[index]
content = def.children.concat()
tail = content[content.length - 1]
backReference = {
type: 'link',
url: '#fnref-' + def.identifier,
data: {hProperties: {className: ['footnote-backref']}},
children: [{type: 'text', value: '↩'}]
}
if (!tail || tail.type !== 'paragraph') {
tail = {type: 'paragraph', children: []}
content.push(tail)
}
tail.children.push(backReference)
listItems[index] = {
type: 'listItem',
data: {hProperties: {id: 'fn-' + def.identifier}},
children: content,
position: def.position
}
}
return h(
null,
'div',
{className: ['footnotes']},
wrap(
[
thematicBreak(h),
list(h, {type: 'list', ordered: true, children: listItems})
],
true
)
)
}