Skip to content

Commit 469e7a0

Browse files
committed
update tests
Signed-off-by: rishichawda <[email protected]>
1 parent 977efba commit 469e7a0

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

__tests__/__fixtures__/bonus/output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="remark-note bonus"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1+
<blockquote class="remark-note bonus"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
22
<g stroke-linecap="round" stroke-linejoin="round"></g>
33
<g>
44
<path
@@ -12,4 +12,4 @@
1212
stroke-width="1.5" stroke-linecap="round"></path>
1313
</g>
1414
</svg></span><span class="remark-note-title">bonus</span></div><div class="remark-note-content"><p>This is a bonus block.
15-
Extra info for advanced users.</p></div></div>
15+
Extra info for advanced users.</p></div></blockquote>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="remark-note important"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
1+
<blockquote class="remark-note important"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
22
<g stroke-width="0"></g>
33
<g stroke-linecap="round" stroke-linejoin="round"></g>
44
<g>
@@ -7,4 +7,4 @@
77
<path fill="currentColor" d="M10,4H8a1,1,0,0,0-.97,1.2425l1,4a1,1,0,0,0,1.94,0l1-4A1,1,0,0,0,10,4Zm0,2h0Z"></path>
88
</g>
99
</svg></span><span class="remark-note-title">important</span></div><div class="remark-note-content"><p>This is an important block.
10-
Pay attention to this!</p></div></div>
10+
Pay attention to this!</p></div></blockquote>

__tests__/__fixtures__/note/output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="remark-note note"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1+
<blockquote class="remark-note note"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
22
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.048">
33
</g>
44
<g>
@@ -15,4 +15,4 @@
1515
</path>
1616
</g>
1717
</svg></span><span class="remark-note-title">note</span></div><div class="remark-note-content"><p>This is a note block.
18-
It supports <strong>bold</strong> and <em>italic</em> text.</p></div></div>
18+
It supports <strong>bold</strong> and <em>italic</em> text.</p></div></blockquote>

__tests__/__fixtures__/quote/output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="remark-note quote"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1+
<blockquote class="remark-note quote"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
22
<g stroke-linecap="round" stroke-linejoin="round"></g>
33
<g>
44
<path
@@ -9,4 +9,4 @@
99
stroke-width="1.5" stroke-linejoin="round"></path>
1010
</g>
1111
</svg></span><span class="remark-note-title">quote</span></div><div class="remark-note-content"><p>This is a quote block.
12-
"To be or not to be."</p></div></div>
12+
"To be or not to be."</p></div></blockquote>

__tests__/__fixtures__/tip/output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="remark-note tip"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
1+
<blockquote class="remark-note tip"><div class="remark-note-header"><span class="remark-note-icon"><svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
22
<g stroke-linecap="round" stroke-linejoin="round"></g>
33
<g>
44
<path
@@ -11,4 +11,4 @@
1111
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
1212
</g>
1313
</svg></span><span class="remark-note-title">tip</span></div><div class="remark-note-content"><p>This is a tip block.
14-
Use it for helpful advice.</p></div></div>
14+
Use it for helpful advice.</p></div></blockquote>

__tests__/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { unified } from 'unified'
77
import remarkParse from 'remark-parse'
88
import remarkNotes from '../index.js'
99
import remarkRehype from 'remark-rehype'
10+
import rehypeRaw from 'rehype-raw'
1011
import rehypeStringify from 'rehype-stringify'
1112
import rehypeParse from 'rehype-parse'
1213

@@ -40,12 +41,13 @@ for (const type of FIXTURE_TYPES) {
4041
const inputMd = readFileSync(inputPath, 'utf8')
4142
const expectedHtml = readFileSync(outputPath, 'utf8')
4243

43-
// Run plugin pipeline
44+
// Run plugin pipeline (testing zero-config with allowDangerousHtml)
4445
const result = await unified()
4546
.use(remarkParse)
4647
.use(remarkNotes)
4748
.use(remarkRehype, { allowDangerousHtml: true })
48-
.use(rehypeStringify, { allowDangerousHtml: true })
49+
.use(rehypeRaw) // Process raw HTML nodes (SVG icons and element structure)
50+
.use(rehypeStringify)
4951
.process(inputMd)
5052
const actualHtml = String(result)
5153

0 commit comments

Comments
 (0)