diff --git a/lib/index.js b/lib/index.js index 1fede8d..ec7eb22 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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 diff --git a/readme.md b/readme.md index 8c126fa..5d3601c 100644 --- a/readme.md +++ b/readme.md @@ -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: @@ -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.