[ci] yarn format
This commit is contained in:
parent
2770588867
commit
79f8cfee60
2 changed files with 16 additions and 10 deletions
|
@ -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}`;
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue