mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +02:00
fix(utils): better handling of code blocks in link replacement (#9046)
This commit is contained in:
parent
dcce8ff3cd
commit
76f920359b
3 changed files with 73 additions and 9 deletions
|
@ -371,6 +371,32 @@ The following operations are defined for [URI]s:
|
|||
[URL](./file.md?foo=bar#baz)
|
||||
[URL](./file.md#a)
|
||||
[URL](./file.md?c)
|
||||
`,
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('handles unpaired fences', () => {
|
||||
expect(
|
||||
replaceMarkdownLinks({
|
||||
siteDir: '.',
|
||||
filePath: 'docs/file.md',
|
||||
contentPaths: {
|
||||
contentPath: 'docs',
|
||||
contentPathLocalized: 'i18n/docs-localized',
|
||||
},
|
||||
sourceToPermalink: {
|
||||
'@site/docs/file.md': '/docs/file',
|
||||
},
|
||||
fileString: `
|
||||
\`\`\`foo
|
||||
hello
|
||||
|
||||
\`\`\`foo
|
||||
hello
|
||||
\`\`\`
|
||||
|
||||
A [link](./file.md)
|
||||
`,
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue