diff options
author | 2023-01-09 10:23:21 +0100 | |
---|---|---|
committer | 2023-01-09 10:23:21 +0100 | |
commit | 16107b6a10514ef1b563e585ec9add4b14f42b94 (patch) | |
tree | 7aeedf42016e63b81f58dd24050cc83eae7a3dd8 /packages/markdown/remark/test/autolinking.test.js | |
parent | 54076a41ebf5da421370a130b97a6406f094042e (diff) | |
download | astro-16107b6a10514ef1b563e585ec9add4b14f42b94.tar.gz astro-16107b6a10514ef1b563e585ec9add4b14f42b94.tar.zst astro-16107b6a10514ef1b563e585ec9add4b14f42b94.zip |
Remove Astro-flavored Markdown from `@astrojs/markdown-remark` (#5785)
Diffstat (limited to 'packages/markdown/remark/test/autolinking.test.js')
-rw-r--r-- | packages/markdown/remark/test/autolinking.test.js | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/packages/markdown/remark/test/autolinking.test.js b/packages/markdown/remark/test/autolinking.test.js index c5cd64657..48bf894be 100644 --- a/packages/markdown/remark/test/autolinking.test.js +++ b/packages/markdown/remark/test/autolinking.test.js @@ -33,76 +33,4 @@ describe('autolinking', () => { ); }); }); - - describe('astro-flavored md', () => { - const renderAstroMd = (text) => renderMarkdown(text, { isAstroFlavoredMd: true }); - - it('does not autolink URLs in code blocks', async () => { - const { code } = await renderAstroMd( - 'See `https://example.com` or `www.example.com` for more.', - {} - ); - - chai - .expect(code.trim()) - .to.equal( - `<p>See <code is:raw>https://example.com</code> or ` + - `<code is:raw>www.example.com</code> for more.</p>` - ); - }); - - it('does not autolink URLs in fenced code blocks', async () => { - const { code } = await renderAstroMd( - 'Example:\n```\nGo to https://example.com or www.example.com now.\n```' - ); - - chai - .expect(code) - .to.contain(`<pre is:raw`) - .to.contain(`Go to https://example.com or www.example.com now.`); - }); - - it('does not autolink URLs starting with a protocol when nested inside links', async () => { - const { code } = await renderAstroMd( - `See [http://example.com](http://example.com) or ` + - `<a test href="https://example.com">https://example.com</a>` - ); - - chai - .expect(code.replace(/\n/g, '')) - .to.equal( - `<p>See <a href="http://example.com">http://example.com</a> or ` + - `<a test href="https://example.com">https://example.com</a></p>` - ); - }); - - it('does not autolink URLs starting with "www." when nested inside links', async () => { - const { code } = await renderAstroMd( - `See [www.example.com](https://www.example.com) or ` + - `<a test href="https://www.example.com">www.example.com</a>` - ); - - chai - .expect(code.replace(/\n/g, '')) - .to.equal( - `<p>See <a href="https://www.example.com">www.example.com</a> or ` + - `<a test href="https://www.example.com">www.example.com</a></p>` - ); - }); - - it('does not autolink URLs when nested several layers deep inside links', async () => { - const { code } = await renderAstroMd( - `<a href="https://www.example.com">**Visit _our www.example.com or ` + - `http://localhost pages_ for more!**</a>` - ); - - chai - .expect(code.replace(/\n/g, '')) - .to.equal( - `<a href="https://www.example.com"><strong>` + - `Visit <em>our www.example.com or http://localhost pages</em> for more!` + - `</strong></a>` - ); - }); - }); }); |