parseMarkdownContentTitle: extremely slow Regex #4726
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
pr: performance
This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient.
🐛 Bug Report
We have a regex perf issue when extracting the markdown title from content, and it can significantly affect a Docusaurus site, making it totally unusable.
@lex111 this seems related to your change here: #4646
Removing the part that excludes the MDX imports solves the perf problem.
Temporary workaround: use a Markdown title at the top of the file, above the MDX imports to solve this problem:
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Originally reported here: #4713
This is not a Webpack 5 bug, it happens on alpha 74 too (author upgraded from 70->75)
Repo/branch: https://github.com/hanabi/hanabi.github.io/tree/doc-bug
(requires Python3, not the most convenient repro).
Example problematic file: https://github.com/hanabi/hanabi.github.io/blob/doc-bug/docs/beginner.md
Using a lot of MDX imports at the top:
The text was updated successfully, but these errors were encountered: