mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-05 02:47:50 +02:00
fix: ignore code block lines when create excerpt (#5495)
This commit is contained in:
parent
ebf81b6ef6
commit
578470a24c
2 changed files with 22 additions and 0 deletions
|
@ -129,6 +129,19 @@ describe('createExcerpt', () => {
|
|||
`),
|
||||
).toEqual('Markdown title');
|
||||
});
|
||||
|
||||
test('should create excerpt for content with various code blocks', () => {
|
||||
expect(
|
||||
createExcerpt(dedent`
|
||||
\`\`\`jsx
|
||||
import React from 'react';
|
||||
import Layout from '@theme/Layout';
|
||||
\`\`\`
|
||||
|
||||
Lorem \`ipsum\` dolor sit amet, consectetur \`adipiscing elit\`.
|
||||
`),
|
||||
).toEqual('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseMarkdownContentTitle', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue