mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-04 12:47:14 +02:00
fix(v2): ignore style imports in excerpt (#3944)
This commit is contained in:
parent
b133e2def6
commit
2fb766ba7c
2 changed files with 2 additions and 1 deletions
|
@ -386,6 +386,7 @@ describe('load utils', () => {
|
||||||
input: `
|
input: `
|
||||||
import Component from '@site/src/components/Component';
|
import Component from '@site/src/components/Component';
|
||||||
import Component from '@site/src/components/Component'
|
import Component from '@site/src/components/Component'
|
||||||
|
import './styles.css';
|
||||||
|
|
||||||
export function ItemCol(props) { return <Item {...props} className={'col col--6 margin-bottom--lg'}/> }
|
export function ItemCol(props) { return <Item {...props} className={'col col--6 margin-bottom--lg'}/> }
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ export function createExcerpt(fileString: string): string | undefined {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip import/export declaration.
|
// Skip import/export declaration.
|
||||||
if (/^.*import\s.*from.*;?|export\s.*{.*};?/.test(fileLine)) {
|
if (/^\s*?import\s.*(from.*)?;?|export\s.*{.*};?/.test(fileLine)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue