ant-design/.dumi/remarkAntd.ts
MadCcc 5c0bc214cc
docs: fix duplicated desc (#41217)
* docs: fix duplicated desc

* fix: use remark plugin

* chore: fix ghost deps

* chore: better assign

* chore: use regexp

* chore: remove try catch
2023-03-14 20:34:36 +08:00

13 lines
318 B
TypeScript

import { unistUtilVisit } from 'dumi';
export default function remarkMeta() {
return (tree, vFile) => {
// read frontmatter
unistUtilVisit.visit(tree, 'yaml', (node) => {
if (!/(^|[\n\r])description:/.test(node.value)) {
vFile.data.frontmatter.__autoDescription = true;
}
});
};
}