mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
style(v2): reduce number of ESLint warnings (#4993)
* Initial work
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More fixes
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update packages/docusaurus-theme-classic/src/theme/ThemedImage/index.tsx
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Update packages/docusaurus-theme-bootstrap/src/theme/ThemedImage/index.tsx
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Replace versionPathPart with function
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Prefer non-null assertions
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Substitute for-of with forEach
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fill `catch` block with placeholder comment
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Ignore local require
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert global require change
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Tighten eslint disable range
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make eslint ignore examples and more tolerating to templates
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Use reduce to handle doc items sequentially
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert "Use reduce to handle doc items sequentially"
This reverts commit c7525d463b
.
* Address change requests
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
364051f232
commit
462b1cf2bc
20 changed files with 75 additions and 35 deletions
|
@ -36,17 +36,17 @@ export function createExcerpt(fileString: string): string | undefined {
|
|||
// Remove HTML tags.
|
||||
.replace(/<[^>]*>/g, '')
|
||||
// Remove Title headers
|
||||
.replace(/^\#\s*([^#]*)\s*\#?/gm, '')
|
||||
.replace(/^#\s*([^#]*)\s*#?/gm, '')
|
||||
// Remove Markdown + ATX-style headers
|
||||
.replace(/^\#{1,6}\s*([^#]*)\s*(\#{1,6})?/gm, '$1')
|
||||
.replace(/^#{1,6}\s*([^#]*)\s*(#{1,6})?/gm, '$1')
|
||||
// Remove emphasis and strikethroughs.
|
||||
.replace(/([\*_~]{1,3})(\S.*?\S{0,1})\1/g, '$2')
|
||||
.replace(/([*_~]{1,3})(\S.*?\S{0,1})\1/g, '$2')
|
||||
// Remove images.
|
||||
.replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
||||
.replace(/!\[(.*?)\][[(].*?[\])]/g, '$1')
|
||||
// Remove footnotes.
|
||||
.replace(/\[\^.+?\](\: .*?$)?/g, '')
|
||||
.replace(/\[\^.+?\](: .*?$)?/g, '')
|
||||
// Remove inline links.
|
||||
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
||||
.replace(/\[(.*?)\][[(].*?[\])]/g, '$1')
|
||||
// Remove inline code.
|
||||
.replace(/`(.+?)`/g, '$1')
|
||||
// Remove blockquotes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue