-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug-test.js
More file actions
36 lines (25 loc) · 985 Bytes
/
debug-test.js
File metadata and controls
36 lines (25 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { renderMarkdown } = require('./out/renderer.js');
const markdown = `# Header
Some text
- [ ] Task 1
- [x] Task 2
More text
## Another header
- [ ] Task 3`;
console.log('Input markdown:');
console.log(markdown);
console.log('\n===================\n');
const html = renderMarkdown(markdown);
console.log('Output HTML:');
console.log(html);
console.log('\n===================\n');
console.log('Test results:');
console.log('Contains <h1>:', html.includes('<h1>'));
console.log('Contains <h2>:', html.includes('<h2>'));
console.log('Contains <h1 with attributes:', html.includes('<h1 '));
console.log('Contains <h2 with attributes:', html.includes('<h2 '));
// Show the first occurrence of each
const h1Index = html.indexOf('<h1');
const h2Index = html.indexOf('<h2');
console.log('h1 first occurrence:', h1Index >= 0 ? html.slice(h1Index, h1Index + 30) : 'not found');
console.log('h2 first occurrence:', h2Index >= 0 ? html.slice(h2Index, h2Index + 30) : 'not found');