File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,4 +34,26 @@ describe("convertMarkdownToHtml", () => {
3434 ) ;
3535 expect ( ( ) => convertMarkdownToHtml ( 123 ) ) . toThrow ( "Markdown parse error" ) ;
3636 } ) ;
37+
38+ it ( "converts complex markdown with multiple elements" , ( ) => {
39+ const md = `
40+ # Title
41+
42+ This is a paragraph with **bold** text and a [link](https://example.com).
43+
44+ - List item 1
45+ - List item 2
46+
47+ > A blockquote
48+ ` ;
49+ const html = convertMarkdownToHtml ( md ) ;
50+ expect ( html ) . toContain ( "<h1>Title</h1>" ) ;
51+ expect ( html ) . toContain (
52+ '<p>This is a paragraph with <strong>bold</strong> text and a <a href="https://example.com">link</a>.</p>' ,
53+ ) ;
54+ expect ( html ) . toContain (
55+ "<ul>\n<li>List item 1</li>\n<li>List item 2</li>\n</ul>" ,
56+ ) ;
57+ expect ( html ) . toContain ( "<blockquote>\n<p>A blockquote</p>\n</blockquote>" ) ;
58+ } ) ;
3759} ) ;
Original file line number Diff line number Diff line change 1- import { randomUUID } from "node:crypto" ; // Node.js built-in crypto
2- global . crypto = { randomUUID } ; // Mock or polyfill necessary crypto functions
1+ import { randomUUID } from "node:crypto" ;
2+
3+ if ( ! globalThis . crypto ?. randomUUID ) {
4+ Object . defineProperty ( globalThis , "crypto" , {
5+ value : { randomUUID } ,
6+ configurable : true ,
7+ } ) ;
8+ }
You can’t perform that action at this time.
0 commit comments