summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/test/autolinking.test.js
diff options
context:
space:
mode:
authorGravatar natemoo-re <natemoo-re@users.noreply.github.com> 2022-06-10 03:33:13 +0000
committerGravatar github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2022-06-10 03:33:13 +0000
commit4eb39d57b97b02280588a992de6b77153b24f2bb (patch)
tree9cadb2d246e46ad86795f72cb7df58536ca2d47d /packages/markdown/remark/test/autolinking.test.js
parent7f5e71982dc39607339da005457bb32aa4cf96f2 (diff)
downloadastro-4eb39d57b97b02280588a992de6b77153b24f2bb.tar.gz
astro-4eb39d57b97b02280588a992de6b77153b24f2bb.tar.zst
astro-4eb39d57b97b02280588a992de6b77153b24f2bb.zip
[ci] format
Diffstat (limited to 'packages/markdown/remark/test/autolinking.test.js')
-rw-r--r--packages/markdown/remark/test/autolinking.test.js30
1 files changed, 13 insertions, 17 deletions
diff --git a/packages/markdown/remark/test/autolinking.test.js b/packages/markdown/remark/test/autolinking.test.js
index 9224247e0..513d12ac6 100644
--- a/packages/markdown/remark/test/autolinking.test.js
+++ b/packages/markdown/remark/test/autolinking.test.js
@@ -3,10 +3,7 @@ import chai from 'chai';
describe('autolinking', () => {
it('autolinks URLs starting with a protocol in plain text', async () => {
- const { code } = await renderMarkdown(
- `See https://example.com for more.`,
- {}
- );
+ const { code } = await renderMarkdown(`See https://example.com for more.`, {});
chai
.expect(code.replace(/\n/g, ''))
@@ -14,10 +11,7 @@ describe('autolinking', () => {
});
it('autolinks URLs starting with "www." in plain text', async () => {
- const { code } = await renderMarkdown(
- `See www.example.com for more.`,
- {}
- );
+ const { code } = await renderMarkdown(`See www.example.com for more.`, {});
chai
.expect(code.trim())
@@ -32,8 +26,10 @@ describe('autolinking', () => {
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>`);
+ .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 () => {
@@ -51,7 +47,7 @@ describe('autolinking', () => {
it('does not autolink URLs starting with a protocol when nested inside links', async () => {
const { code } = await renderMarkdown(
`See [http://example.com](http://example.com) or ` +
- `<a test href="https://example.com">https://example.com</a>`,
+ `<a test href="https://example.com">https://example.com</a>`,
{}
);
@@ -59,14 +55,14 @@ describe('autolinking', () => {
.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>`
+ `<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 renderMarkdown(
`See [www.example.com](https://www.example.com) or ` +
- `<a test href="https://www.example.com">www.example.com</a>`,
+ `<a test href="https://www.example.com">www.example.com</a>`,
{}
);
@@ -74,14 +70,14 @@ describe('autolinking', () => {
.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>`
+ `<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 renderMarkdown(
`<a href="https://www.example.com">**Visit _our www.example.com or ` +
- `http://localhost pages_ for more!**</a>`,
+ `http://localhost pages_ for more!**</a>`,
{}
);
@@ -89,8 +85,8 @@ describe('autolinking', () => {
.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>`
+ `Visit <em>our www.example.com or http://localhost pages</em> for more!` +
+ `</strong></a>`
);
});
});