Skip to content

Commit 30ba823

Browse files
committed
more cleanup
1 parent 1651c39 commit 30ba823

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

packages/react/scripts/bundle-docs.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ import {toString as mdToString} from 'mdast-util-to-string'
8888
const renderers = new Map()
8989
const tsxPath = join(sourceDir, 'react.tsx')
9090
if (existsSync(tsxPath)) {
91-
// TypeScript, not Markdown, so a small regex over the source is appropriate:
92-
// export const ButtonVariantsProp = () => <PropTableValues values={['a', 'b']} />
91+
// matches lines like: export const ButtonVariantsProp = () => <PropTableValues values={['a', 'b']} />
9392
const pattern = /export const (\w+)\s*=\s*\(\)\s*=>\s*\(?\s*<PropTableValues\s+values=\{(\[[^\]]*\])\}/g
9493
const tsxSource = readFileSync(tsxPath, 'utf8')
9594
for (let match = pattern.exec(tsxSource); match; match = pattern.exec(tsxSource)) {

0 commit comments

Comments
 (0)