@@ -144,6 +144,14 @@ Deno.test("Media URL transformation without base URL", () => {
144
144
assertEquals ( html , expectedWithoutTransformation ) ;
145
145
} ) ;
146
146
147
+ Deno . test ( "simple img test" , ( ) => {
148
+ const markdown = "" ;
149
+ const result = `<p><img src="image.jpg" alt="asdf" /></p>\n` ;
150
+
151
+ const html = render ( markdown ) ;
152
+ assertEquals ( html , result ) ;
153
+ } ) ;
154
+
147
155
Deno . test ( "Media URL transformation with invalid URL" , ( ) => {
148
156
const markdown = "" ;
149
157
const mediaBaseUrl = "this is an invalid url" ;
@@ -288,7 +296,7 @@ Deno.test("render github-slugger not reused", function () {
288
296
for ( let i = 0 ; i < 2 ; i ++ ) {
289
297
const html = render ( "## Hello" ) ;
290
298
const expected =
291
- `<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>` ;
299
+ `<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>` ;
292
300
assertEquals ( html , expected ) ;
293
301
}
294
302
} ) ;
@@ -346,3 +354,28 @@ Deno.test("details, summary, and del", () => {
346
354
const html = render ( markdown ) ;
347
355
assertEquals ( html , expected . trim ( ) ) ;
348
356
} ) ;
357
+
358
+ Deno . test ( "del tag test" , ( ) => {
359
+ const markdown = "<del>tofu</del>" ;
360
+ const result = `<p><del>tofu</del></p>\n` ;
361
+
362
+ const html = render ( markdown ) ;
363
+ assertEquals ( html , result ) ;
364
+ } ) ;
365
+
366
+ Deno . test ( "h1 test" , ( ) => {
367
+ const markdown = "# Hello" ;
368
+ const result =
369
+ `<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>` ;
370
+
371
+ const html = render ( markdown ) ;
372
+ assertEquals ( html , result ) ;
373
+ } ) ;
374
+
375
+ Deno . test ( "svg test" , ( ) => {
376
+ const markdown = `<svg viewBox="foo"></svg>` ;
377
+ const result = `<p><svg viewBox="foo"></svg></p>\n` ;
378
+
379
+ const html = render ( markdown ) ;
380
+ assertEquals ( html , result ) ;
381
+ } ) ;
0 commit comments