Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Jan 22, 2024
1 parent c07caeb commit 697afd0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 697afd0

Please sign in to comment.