Skip to content

Commit aea5b4b

Browse files
ci: apply automated fixes and generate docs
1 parent 48b8068 commit aea5b4b

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

website/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { rehypeHandleMdExtension } from "./rehype-plugin";
88
// https://astro.build/config
99
export default defineConfig({
1010
markdown: {
11-
rehypePlugins: [rehypeHandleMdExtension]
11+
rehypePlugins: [rehypeHandleMdExtension],
1212
},
1313
integrations: [
1414
react(),

website/rehype-plugin.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
import { visit } from "unist-util-visit";
22

33
export const rehypeHandleMdExtension = () => {
4-
const pattern = /^(\..+)\.md(.*)/;
4+
const pattern = /^(\..+)\.md(.*)/;
55

6-
const canBeProcessed = (node) => (
7-
node.tagName === "a" &&
8-
node.properties.href &&
9-
pattern.test(node.properties.href)
10-
)
6+
const canBeProcessed = (node) =>
7+
node.tagName === "a" &&
8+
node.properties.href &&
9+
pattern.test(node.properties.href);
1110

12-
const processNode = (node) => {
13-
const href = node.properties.href;
14-
const results = href.match(pattern)
15-
node.properties.href = `${results[1]}${results[2]}`;
16-
}
11+
const processNode = (node) => {
12+
const href = node.properties.href;
13+
const results = href.match(pattern);
14+
node.properties.href = `${results[1]}${results[2]}`;
15+
};
1716

18-
return (tree) => {
19-
visit(tree, "element", (node) => {
20-
canBeProcessed(node) && processNode(node)
21-
})
22-
}
23-
}
17+
return (tree) => {
18+
visit(tree, "element", (node) => {
19+
canBeProcessed(node) && processNode(node);
20+
});
21+
};
22+
};

0 commit comments

Comments
 (0)