@speajus/markdown-to-pdf 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.pdf +0 -0
- package/dist/renderer.js +11 -0
- package/package.json +1 -1
package/README.pdf
CHANGED
|
Binary file
|
package/dist/renderer.js
CHANGED
|
@@ -589,6 +589,17 @@ async function renderMarkdownToPdf(markdown, options) {
|
|
|
589
589
|
renderTextWithEmoji(t.text);
|
|
590
590
|
}
|
|
591
591
|
headingCtx = null;
|
|
592
|
+
// Draw an underline beneath h1 and h2
|
|
593
|
+
if (t.depth <= 2) {
|
|
594
|
+
const lineY = doc.y + 2;
|
|
595
|
+
doc.save();
|
|
596
|
+
doc.strokeColor(theme.horizontalRuleColor).lineWidth(t.depth === 1 ? 1.5 : 1)
|
|
597
|
+
.moveTo(margins.left, lineY)
|
|
598
|
+
.lineTo(margins.left + contentWidth, lineY)
|
|
599
|
+
.stroke();
|
|
600
|
+
doc.restore();
|
|
601
|
+
doc.y = lineY + 2;
|
|
602
|
+
}
|
|
592
603
|
doc.moveDown(spaceBelow / doc.currentLineHeight());
|
|
593
604
|
resetBodyFont();
|
|
594
605
|
break;
|