Skip to content

Commit 17b92b2

Browse files
committed
fix: formating test file
1 parent 3317486 commit 17b92b2

File tree

1 file changed

+36
-18
lines changed

1 file changed

+36
-18
lines changed

test/test.ts

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@ Deno.test(
5757

5858
Deno.test("bug #61 generate a tag", () => {
5959
const markdown = "[link](https://example.com)";
60-
const expected = `<p><a href="https://example.com" rel="noopener noreferrer">link</a></p>\n`;
60+
const expected =
61+
`<p><a href="https://example.com" rel="noopener noreferrer">link</a></p>\n`;
6162
const html = render(markdown);
6263
assertEquals(html, expected);
6364
});
6465

6566
Deno.test("bug #61 generate a tag with disableHtmlSanitization", () => {
6667
const markdown = "[link](https://example.com)";
67-
const expected = `<p><a href="https://example.com" rel="noopener noreferrer">link</a></p>\n`;
68+
const expected =
69+
`<p><a href="https://example.com" rel="noopener noreferrer">link</a></p>\n`;
6870
const html = render(markdown, { disableHtmlSanitization: true });
6971
assertEquals(html, expected);
7072
});
@@ -112,7 +114,8 @@ Deno.test("alerts rendering", async () => {
112114
Deno.test("Iframe rendering", () => {
113115
const markdown =
114116
'Here is an iframe:\n\n<iframe src="https://example.com" width="300" height="200"></iframe>';
115-
const expected = `<p>Here is an iframe:</p>\n<iframe src="https://example.com" width="300" height="200"></iframe>`;
117+
const expected =
118+
`<p>Here is an iframe:</p>\n<iframe src="https://example.com" width="300" height="200"></iframe>`;
116119

117120
const html = render(markdown, { allowIframes: true });
118121
assertEquals(html, expected);
@@ -130,15 +133,17 @@ Deno.test("Iframe rendering disabled", () => {
130133
Deno.test("Media URL transformation", () => {
131134
const markdown = "![Image](image.jpg)\n\n![Video](video.mp4)";
132135
const mediaBaseUrl = "https://cdn.example.com/";
133-
const expected = `<p><img src="https://cdn.example.com/image.jpg" alt="Image" /></p>\n<p><img src="https://cdn.example.com/video.mp4" alt="Video" /></p>\n`;
136+
const expected =
137+
`<p><img src="https://cdn.example.com/image.jpg" alt="Image" /></p>\n<p><img src="https://cdn.example.com/video.mp4" alt="Video" /></p>\n`;
134138

135139
const html = render(markdown, { mediaBaseUrl: mediaBaseUrl });
136140
assertEquals(html, expected);
137141
});
138142

139143
Deno.test("Media URL transformation without base URL", () => {
140144
const markdown = "![Image](image.jpg)\n\n![Video](video.mp4)";
141-
const expectedWithoutTransformation = `<p><img src="image.jpg" alt="Image" /></p>\n<p><img src="video.mp4" alt="Video" /></p>\n`;
145+
const expectedWithoutTransformation =
146+
`<p><img src="image.jpg" alt="Image" /></p>\n<p><img src="video.mp4" alt="Video" /></p>\n`;
142147

143148
const html = render(markdown);
144149
assertEquals(html, expectedWithoutTransformation);
@@ -163,15 +168,17 @@ Deno.test("Media URL transformation with invalid URL", () => {
163168

164169
Deno.test("Inline rendering", () => {
165170
const markdown = "My [Deno](https://deno.land) Blog";
166-
const expected = `My <a href="https://deno.land" rel="noopener noreferrer">Deno</a> Blog`;
171+
const expected =
172+
`My <a href="https://deno.land" rel="noopener noreferrer">Deno</a> Blog`;
167173

168174
const html = render(markdown, { inline: true });
169175
assertEquals(html, expected);
170176
});
171177

172178
Deno.test("Inline rendering false", () => {
173179
const markdown = "My [Deno](https://deno.land) Blog";
174-
const expected = `<p>My <a href="https://deno.land" rel="noopener noreferrer">Deno</a> Blog</p>\n`;
180+
const expected =
181+
`<p>My <a href="https://deno.land" rel="noopener noreferrer">Deno</a> Blog</p>\n`;
175182

176183
const html = render(markdown, { inline: false });
177184
assertEquals(html, expected);
@@ -180,15 +187,17 @@ Deno.test("Inline rendering false", () => {
180187
Deno.test("Link URL resolution with base URL", () => {
181188
const markdown = "[Test Link](/path/to/resource)";
182189
const baseUrl = "https://example.com/";
183-
const expected = `<p><a href="https://example.com/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
190+
const expected =
191+
`<p><a href="https://example.com/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
184192

185193
const html = render(markdown, { baseUrl: baseUrl });
186194
assertEquals(html, expected);
187195
});
188196

189197
Deno.test("Link URL resolution without base URL", () => {
190198
const markdown = "[Test Link](/path/to/resource)";
191-
const expected = `<p><a href="/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
199+
const expected =
200+
`<p><a href="/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
192201

193202
const html = render(markdown);
194203
assertEquals(html, expected);
@@ -197,7 +206,8 @@ Deno.test("Link URL resolution without base URL", () => {
197206
Deno.test("Link URL resolution with invalid URL and base URL", () => {
198207
const markdown = "[Test Link](/path/to/resource)";
199208
const baseUrl = "this is an invalid url";
200-
const expected = `<p><a href="/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
209+
const expected =
210+
`<p><a href="/path/to/resource" rel="noopener noreferrer">Test Link</a></p>\n`;
201211

202212
const html = render(markdown, { baseUrl: baseUrl });
203213
assertEquals(html, expected);
@@ -242,15 +252,17 @@ Deno.test("image title and no alt", () => {
242252

243253
Deno.test("js language", () => {
244254
const markdown = "```js\nconst foo = 'bar';\n```";
245-
const expected = `<div class="highlight highlight-source-js notranslate"><pre><span class="token keyword">const</span> foo <span class="token operator">=</span> <span class="token string">'bar'</span><span class="token punctuation">;</span></pre></div>`;
255+
const expected =
256+
`<div class="highlight highlight-source-js notranslate"><pre><span class="token keyword">const</span> foo <span class="token operator">=</span> <span class="token string">'bar'</span><span class="token punctuation">;</span></pre></div>`;
246257

247258
const html = render(markdown);
248259
assertEquals(html, expected);
249260
});
250261

251262
Deno.test("code fence with a title", () => {
252263
const markdown = "```js title=\"index.ts\"\nconst foo = 'bar';\n```";
253-
const expected = `<div class="highlight highlight-source-js notranslate"><div class="markdown-code-title">index.ts</div><pre><span class="token keyword">const</span> foo <span class="token operator">=</span> <span class="token string">'bar'</span><span class="token punctuation">;</span></pre></div>`;
264+
const expected =
265+
`<div class="highlight highlight-source-js notranslate"><div class="markdown-code-title">index.ts</div><pre><span class="token keyword">const</span> foo <span class="token operator">=</span> <span class="token string">'bar'</span><span class="token punctuation">;</span></pre></div>`;
254266

255267
const html = render(markdown);
256268
assertEquals(html, expected);
@@ -292,7 +304,8 @@ Deno.test("code containing mermaid", () => {
292304

293305
Deno.test("link with title", () => {
294306
const markdown = `[link](https://example.com "asdf")`;
295-
const expected = `<p><a href="https://example.com" title="asdf" rel="noopener noreferrer">link</a></p>\n`;
307+
const expected =
308+
`<p><a href="https://example.com" title="asdf" rel="noopener noreferrer">link</a></p>\n`;
296309
const html = render(markdown);
297310
assertEquals(html, expected);
298311
});
@@ -305,7 +318,8 @@ Deno.test("expect console warning from invalid math", () => {
305318
};
306319

307320
const html = render("$$ +& $$", { allowMath: true });
308-
const expected = `<p>$$ +&amp; <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span></p>\n`;
321+
const expected =
322+
`<p>$$ +&amp; <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span></p>\n`;
309323
assertEquals(html, expected);
310324
assertStringIncludes(
311325
warnCalls[0],
@@ -326,7 +340,8 @@ Deno.test("expect console warning from invalid math", () => {
326340
Deno.test("render github-slugger not reused", function () {
327341
for (let i = 0; i < 2; i++) {
328342
const html = render("## Hello");
329-
const expected = `<h2 id="hello"><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello"><svg class="octicon octicon-link" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Hello</h2>\n`;
343+
const expected =
344+
`<h2 id="hello"><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello"><svg class="octicon octicon-link" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Hello</h2>\n`;
330345
assertEquals(html, expected);
331346
}
332347
});
@@ -398,7 +413,8 @@ Deno.test("del tag test", () => {
398413

399414
Deno.test("h1 test", () => {
400415
const markdown = "# Hello";
401-
const result = `<h1 id="hello"><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello"><svg class="octicon octicon-link" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Hello</h1>\n`;
416+
const result =
417+
`<h1 id="hello"><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello"><svg class="octicon octicon-link" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Hello</h1>\n`;
402418

403419
const html = render(markdown);
404420
assertEquals(html, result);
@@ -427,8 +443,10 @@ Deno.test("task list", () => {
427443
});
428444

429445
Deno.test("anchor test raw", () => {
430-
const markdown = `<a class="anchor" aria-hidden="true" tabindex="-1" href="#hello">foo</a>`;
431-
const result = `<p><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello">foo</a></p>\n`;
446+
const markdown =
447+
`<a class="anchor" aria-hidden="true" tabindex="-1" href="#hello">foo</a>`;
448+
const result =
449+
`<p><a class="anchor" aria-hidden="true" tabindex="-1" href="#hello">foo</a></p>\n`;
432450

433451
const html = render(markdown);
434452
assertEquals(html, result);

0 commit comments

Comments
 (0)