There was an error while loading. Please reload this page.
1 parent 1651c39 commit 30ba823Copy full SHA for 30ba823
1 file changed
packages/react/scripts/bundle-docs.mjs
@@ -88,8 +88,7 @@ import {toString as mdToString} from 'mdast-util-to-string'
88
const renderers = new Map()
89
const tsxPath = join(sourceDir, 'react.tsx')
90
if (existsSync(tsxPath)) {
91
- // TypeScript, not Markdown, so a small regex over the source is appropriate:
92
- // export const ButtonVariantsProp = () => <PropTableValues values={['a', 'b']} />
+ // matches lines like: export const ButtonVariantsProp = () => <PropTableValues values={['a', 'b']} />
93
const pattern = /export const (\w+)\s*=\s*\(\)\s*=>\s*\(?\s*<PropTableValues\s+values=\{(\[[^\]]*\])\}/g
94
const tsxSource = readFileSync(tsxPath, 'utf8')
95
for (let match = pattern.exec(tsxSource); match; match = pattern.exec(tsxSource)) {
0 commit comments