docs: correct style extract from markdown demo (#38637)

This commit is contained in:
Peach 2022-11-17 21:13:31 +08:00 committed by GitHub
parent dc6bcc8acb
commit 9dcc4aab2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ class AntdReactTechStack extends ReactTechStack {
const description = md.match(
new RegExp(`(?:^|\\n)## ${locale}([^]+?)(\\n## [a-z]|\\n\`\`\`|\\n<style>|$)`),
)?.[1];
const style = md.match(/\n```css\n([^]+?)\n```|\n<style>\n([^]+?)\n<\/style>/)?.[1];
const style = md.match(/\n(?:```css|<style>)\n([^]+?)\n(?:```|<\/style>)/)?.[1];
props.description ??= description?.trim();
props.style ??= style;