You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tables missing `<thead>` use the first row as header:
558
+
559
+
```javascript
560
+
consthtml=`
561
+
<table>
562
+
<tr><td>A</td><td>B</td></tr>
563
+
<tr><td>1</td><td>2</td></tr>
564
+
</table>`;
565
+
// Output:
566
+
// | A | B |
567
+
// | --- | --- |
568
+
// | 1 | 2 |
569
+
```
570
+
571
+
### Mixed Content in Lists
572
+
573
+
List items with mixed block/inline content are handled:
574
+
575
+
```javascript
576
+
consthtml=`
577
+
<ul>
578
+
<li>Simple item</li>
579
+
<li>
580
+
<p>Paragraph in list</p>
581
+
<pre><code>code block</code></pre>
582
+
</li>
583
+
</ul>`;
584
+
// Outputs proper markdown with preserved formatting
585
+
```
586
+
587
+
## Troubleshooting
588
+
589
+
### Empty or Minimal Output
590
+
591
+
**Problem:**`convert()` returns empty string or very little content.
592
+
593
+
**Causes & Solutions:**
594
+
595
+
1.**Content is in excluded elements** - Check if your content is inside `nav`, `header`, etc. that might match default patterns
596
+
```javascript
597
+
// Try without selectors first
598
+
constmarkdown=convert(html);
599
+
```
600
+
601
+
2.**JavaScript-rendered content** - supermarkdown converts static HTML only. If the page uses client-side rendering, you need to render it first (e.g., with Puppeteer or Playwright)
602
+
603
+
3.**Content in iframes** - iframe content is not extracted. Fetch iframe src separately if needed
604
+
605
+
### Missing Code Block Language
606
+
607
+
**Problem:** Code blocks don't have language annotation.
608
+
609
+
**Solution:** supermarkdown looks for `language-*`, `lang-*`, or `highlight-*` class patterns. Ensure your HTML uses standard class naming:
2.**Nested tables** - GFM doesn't support nested tables; inner tables are flattened
628
+
3.**colspan/rowspan** - These are not supported in GFM; content goes in first cell
629
+
630
+
### Links Missing or Broken
631
+
632
+
**Problem:** Links don't appear or have wrong URLs.
633
+
634
+
**Solutions:**
635
+
636
+
1.**Relative URLs** - Use `baseUrl` option to resolve relative links:
637
+
```javascript
638
+
convert(html, { baseUrl:"https://example.com" });
639
+
```
640
+
641
+
2.**Links in excluded elements** - Navigation links are often in `<nav>` which may be excluded
642
+
643
+
### Performance Issues with Large Documents
644
+
645
+
**Problem:** Conversion is slow for very large HTML files.
646
+
647
+
**Solutions:**
648
+
649
+
1.**Use async** - `convertAsync()` won't block the event loop
650
+
2.**Pre-filter HTML** - Remove obvious non-content before conversion
651
+
3.**Stream processing** - For very large docs, consider splitting into sections
652
+
653
+
### Special Characters Appearing Wrong
654
+
655
+
**Problem:** Characters like `<`, `>`, `&` appear as entities.
656
+
657
+
**Solution:** This is usually correct behavior - these characters need escaping in markdown. If you're seeing `&` where you expect `&`, the source HTML may have double-encoded entities.
0 commit comments