Skip to content

Commit

Permalink
Add use of top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 1, 2022
1 parent 1dc8ab3 commit b72dc7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ function factory(tree, options) {
: settings.clobberPrefix
h.footnoteLabel = settings.footnoteLabel || 'Footnotes'
h.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'
h.footnoteLabelProperties = settings.footnoteLabelProperties || {id: 'footnote-label', className: ['sr-only']}
h.footnoteLabelProperties = settings.footnoteLabelProperties || {
id: 'footnote-label',
className: ['sr-only']
}
h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'
h.definition = definitions(tree)
h.footnoteById = footnoteById
Expand Down
16 changes: 6 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,12 @@ import {fromMarkdown} from 'mdast-util-from-markdown'
import {toHast} from 'mdast-util-to-hast'
import {toHtml} from 'hast-util-to-html'

main()

async function main() {
const markdown = String(await fs.readFile('example.md'))
const mdast = fromMarkdown(markdown)
const hast = toHast(mdast)
const html = toHtml(hast)
const markdown = String(await fs.readFile('example.md'))
const mdast = fromMarkdown(markdown)
const hast = toHast(mdast)
const html = toHtml(hast)

console.log(html)
}
console.log(html)
```

…now running `node example.js` yields:
Expand Down Expand Up @@ -189,7 +185,7 @@ choice of css.
###### `options.footnoteLabelProperties`

Properties to use on the footnote label (`object`, default: `{id:
Properties to use on the footnote label (`object`, default: `{id:
'footnote-label', className: ['sr-only']}`).
A `sr-only` class is added by default to hide this from sighted users.
Change it to make the label visible, or add classes for other purposes.
Expand Down

0 comments on commit b72dc7c

Please sign in to comment.