mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-29 05:12:52 +00:00
* Don't replace any relative links to static assets in a fenced code block * revert unintended docs change * improve regex * remove test file :sob * stronger regex test for replace assets * super simplify solution
98 lines
1.6 KiB
Plaintext
98 lines
1.6 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`mdToHtmlify transform nothing 1`] = `
|
|
"
|
|
Docusaurus is the best :)
|
|
|
|

|
|
|
|
\`\`\`js
|
|
console.log(\\"Docusaurus\\");
|
|
\`\`\`
|
|
|
|

|
|

|
|
|
|
Don't replace the one below
|
|
\`\`\`md
|
|
|
|

|
|
\`\`\`"
|
|
`;
|
|
|
|
exports[`mdToHtmlify transform to correct link 1`] = `
|
|
"
|
|
### Existing Docs
|
|
|
|
- [doc1](/docs/en/next/doc1)
|
|
- [doc2](/docs/en/next/doc2)
|
|
|
|
### Non-existing Docs
|
|
|
|
- [hahaha](hahaha.md)
|
|
|
|
## Repeating Docs
|
|
|
|
- [doc1](/docs/en/next/doc1)
|
|
- [doc2](/docs/en/next/doc2)
|
|
|
|
## Do not replace this
|
|
\`\`\`md
|
|

|
|
\`\`\`
|
|
|
|
\`\`\`js
|
|
const doc1 = foo();
|
|
console.log(\\"[image2](assets/image2.jpg)\\");
|
|
const testStr = \`\`;
|
|
\`\`\`"
|
|
`;
|
|
|
|
exports[`replaceAssetsLink does not transform document without valid assets link 1`] = `
|
|
"
|
|
### Existing Docs
|
|
|
|
- [doc1](doc1.md)
|
|
- [doc2](./doc2.md)
|
|
|
|
### Non-existing Docs
|
|
|
|
- [hahaha](hahaha.md)
|
|
|
|
## Repeating Docs
|
|
|
|
- [doc1](doc1.md)
|
|
- [doc2](./doc2.md)
|
|
|
|
## Do not replace this
|
|
\`\`\`md
|
|

|
|
\`\`\`
|
|
|
|
\`\`\`js
|
|
const doc1 = foo();
|
|
console.log(\\"[image2](assets/image2.jpg)\\");
|
|
const testStr = \`\`;
|
|
\`\`\`"
|
|
`;
|
|
|
|
exports[`replaceAssetsLink transform document with valid assets link 1`] = `
|
|
"
|
|
Docusaurus is the best :)
|
|
|
|

|
|
|
|
\`\`\`js
|
|
console.log(\\"Docusaurus\\");
|
|
\`\`\`
|
|
|
|

|
|

|
|
|
|
Don't replace the one below
|
|
\`\`\`md
|
|
|
|

|
|
\`\`\`"
|
|
`;
|