summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2022-01-04 20:10:42 +0000
committerGravatar GitHub Actions <actions@github.com> 2022-01-04 20:10:42 +0000
commit79f8cfee60ee07d09575c357f2dad2e73835318f (patch)
tree3d53cf3a2a0c13034e15a286482cfd9e8d6eafb5
parent27705888678a662c9222e7baa555448f5fc259ed (diff)
downloadastro-79f8cfee60ee07d09575c357f2dad2e73835318f.tar.gz
astro-79f8cfee60ee07d09575c357f2dad2e73835318f.tar.zst
astro-79f8cfee60ee07d09575c357f2dad2e73835318f.zip
[ci] yarn format
-rw-r--r--examples/with-markdown-plugins/add-classes.mjs20
-rw-r--r--packages/astro/test/astro-markdown-plugins.test.js6
2 files changed, 16 insertions, 10 deletions
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',
+ ],
},
],
},