diff --git a/examples/with-markdown-plugins/add-classes.mjs b/examples/with-markdown-plugins/add-classes.mjs index 54879e55d..39acabd52 100644 --- a/examples/with-markdown-plugins/add-classes.mjs +++ b/examples/with-markdown-plugins/add-classes.mjs @@ -1,16 +1,18 @@ import { selectAll } from 'hast-util-select'; -export default additions => { - const adders = Object.entries(additions).map(adder); - return node => adders.forEach(a => a(node)); +export default (additions) => { + const adders = Object.entries(additions).map(adder); + return (node) => adders.forEach((a) => a(node)); }; const adder = ([selector, className]) => { - const writer = write(className); - return node => selectAll(selector, node).forEach(writer); + const writer = write(className); + return (node) => selectAll(selector, node).forEach(writer); }; -const write = className => ({ properties }) => { - if(!properties.className) properties.className = className; - else properties.className += ` ${className}`; -}; +const write = + (className) => + ({ properties }) => { + if (!properties.className) properties.className = className; + else properties.className += ` ${className}`; + }; diff --git a/packages/astro/test/astro-markdown-plugins.test.js b/packages/astro/test/astro-markdown-plugins.test.js index d412be897..aca9fcf7b 100644 --- a/packages/astro/test/astro-markdown-plugins.test.js +++ b/packages/astro/test/astro-markdown-plugins.test.js @@ -15,7 +15,11 @@ describe('Astro Markdown plugins', () => { markdownRemark, { remarkPlugins: ['remark-code-titles', ['rehype-autolink-headings', { behavior: 'prepend' }]], - rehypePlugins: [[import('rehype-toc'), { headings: ['h2', 'h3'] }], [import('../../../examples/with-markdown-plugins/add-classes.mjs'), { 'h1,h2,h3': 'title' }], 'rehype-slug'], + rehypePlugins: [ + [import('rehype-toc'), { headings: ['h2', 'h3'] }], + [import('../../../examples/with-markdown-plugins/add-classes.mjs'), { 'h1,h2,h3': 'title' }], + 'rehype-slug', + ], }, ], },