mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-13 00:03:57 +02:00
fix(v1): fenced block detection (#3340)
This commit is contained in:
parent
306d3afc0a
commit
8fd5375b26
2 changed files with 17 additions and 1 deletions
|
@ -91,4 +91,20 @@ describe('server utils', () => {
|
|||
expect(utils.getSubDir(docE, docsDir)).toBeNull();
|
||||
expect(utils.getSubDir(docE, translatedDir)).toEqual('lol/lah');
|
||||
});
|
||||
|
||||
describe('replaceAssetsLink', () => {
|
||||
test('verifies asset link is replaced after code block', () => {
|
||||
const content = '```Some block```\n more text';
|
||||
const link = utils.replaceAssetsLink(content, 'thelocation');
|
||||
expect(link).toBe(
|
||||
'```Some block```\n more text',
|
||||
);
|
||||
});
|
||||
|
||||
test('verifies asset link is not replaced inside a fenced code block', () => {
|
||||
const content = '```\n\n```';
|
||||
const link = utils.replaceAssetsLink(content, 'thelocation');
|
||||
expect(link).toBe('```\n\n```');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue