Skip to content

Commit cfd6d52

Browse files
committed
Upgrade github.com/gomarkdown/markdown version
See https://github.com/mandolyte/mdtopdf/security/dependabot/7
1 parent 3104889 commit cfd6d52

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/canhlinh/svg2png v0.0.0-20201124065332-6ba87c82371f
77
github.com/gabriel-vasile/mimetype v1.4.2
88
github.com/go-pdf/fpdf v0.9.0
9-
github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee
9+
github.com/gomarkdown/markdown v0.0.0-20240729212818-a2a9c4f76ef5
1010
github.com/jessp01/gohighlight v0.21.1-7
1111
golang.org/x/exp v0.0.0-20240707233637-46b078467d37
1212
)

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q
77
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
88
github.com/go-pdf/fpdf v0.9.0 h1:PPvSaUuo1iMi9KkaAn90NuKi+P4gwMedWPHhj8YlJQw=
99
github.com/go-pdf/fpdf v0.9.0/go.mod h1:oO8N111TkmKb9D7VvWGLvLJlaZUQVPM+6V42pp3iV4Y=
10-
github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee h1:gvsnG+uIVkOue7HrYAG2ZnOdLoJTqsLyuBFJaU0kX4M=
11-
github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
10+
github.com/gomarkdown/markdown v0.0.0-20240626202925-2eda941fd024 h1:saBP362Qm7zDdDXqv61kI4rzhmLFq3Z1gx34xpl6cWE=
11+
github.com/gomarkdown/markdown v0.0.0-20240626202925-2eda941fd024/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
12+
github.com/gomarkdown/markdown v0.0.0-20240729212818-a2a9c4f76ef5 h1:8QWUW69MXlNdZXnDnD9vEQ1BL8/mm1FTiSesKKHYivk=
13+
github.com/gomarkdown/markdown v0.0.0-20240729212818-a2a9c4f76ef5/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
1214
github.com/jessp01/gohighlight v0.21.1-7 h1:u1CurHm8ogal3AFeDMF97pDJ4aPlPdgZg5PL6ULeTb0=
1315
github.com/jessp01/gohighlight v0.21.1-7/go.mod h1:52r0Yxd1+T9f7uLenaO2/34K3gPOejxCxXwdNc/2Z8Y=
1416
github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 h1:YocNLcTBdEdvY3iDK6jfWXvEaM5OCKkjxPKoJRdB3Gg=

nodeProcessing.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ func (r *PdfRenderer) processText(node *ast.Text) {
5959
if r.cs.peek().isHeader {
6060
r.setStyler(currentStyle)
6161
// get the string width of header value
62-
hw := r.Pdf.GetStringWidth(s) + (2 * r.em)
62+
initialWidth := r.Pdf.GetStringWidth(s)
63+
/* if initialWidth == 0 {
64+
initialWidth = 30
65+
}
66+
log.Println(s + ":")
67+
log.Println(initialWidth)*/
68+
hw := initialWidth + (2 * r.em)
6369
// now append it
6470
cellwidths = append(cellwidths, hw)
6571
// now write it...
@@ -673,6 +679,7 @@ func (r *PdfRenderer) processTableRow(node ast.Node, entering bool) {
673679

674680
func (r *PdfRenderer) processTableCell(node ast.TableCell, entering bool) {
675681
if entering {
682+
676683
r.tracer("TableCell (entering)", "")
677684
x := &containerState{
678685
textStyle: r.Normal, listkind: notlist,

0 commit comments

Comments
 (0)