mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 16:52:39 +02:00
fix(mdx-loader): allow spaces before mdx-code-block
info string (#9776)
This commit is contained in:
parent
c827b6de2d
commit
0266549a51
2 changed files with 34 additions and 2 deletions
|
@ -1251,6 +1251,38 @@ describe('unwrapMdxCodeBlocks', () => {
|
|||
</VersionsProvider>
|
||||
`);
|
||||
});
|
||||
|
||||
it('allow spaces before mdx-code-block info string', () => {
|
||||
expect(
|
||||
unwrapMdxCodeBlocks(dedent`
|
||||
# Title
|
||||
|
||||
\`\`\` mdx-code-block
|
||||
import Comp, {User} from "@site/components/comp"
|
||||
|
||||
<Comp prop="test">
|
||||
<User user={{firstName: "Sébastien"}} />
|
||||
</Comp>
|
||||
|
||||
export const age = 36
|
||||
\`\`\`
|
||||
|
||||
text
|
||||
`),
|
||||
).toEqual(dedent`
|
||||
# Title
|
||||
|
||||
import Comp, {User} from "@site/components/comp"
|
||||
|
||||
<Comp prop="test">
|
||||
<User user={{firstName: "Sébastien"}} />
|
||||
</Comp>
|
||||
|
||||
export const age = 36
|
||||
|
||||
text
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('admonitionTitleToDirectiveLabel', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue