Skip to content

Commit f84fd00

Browse files
committed
Address #72
1 parent aaaab76 commit f84fd00

40 files changed

Lines changed: 31 additions & 24 deletions

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
repos:
23
- repo: https://github.com/jessp01/pre-commit-golang.git
34
rev: v0.5.4
@@ -8,3 +9,9 @@ repos:
89
- id: go-lint
910
- id: go-critic
1011
- id: go-ineffassign
12+
# - repo: https://github.com/crate-ci/typos
13+
# rev: v1.32.0
14+
# hooks:
15+
# - id: typos
16+
# exclude_types: [yaml]
17+
# exclude: go.*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A CLI utility which, as the name implies, generates a PDF from Markdown.
1010

1111
This package depends on two other packages:
1212
- [gomarkdown](https://github.com/gomarkdown/markdown) parser to read the markdown source
13-
- [fpdf](https://github.com/go-pdf/fpdf) to generate the PDF
13+
- [fpdf](https://codeberg.org/go-pdf/fpdf) to generate the PDF
1414

1515
## Features
1616

cmd/chinese.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
> 返回“工作”;
7979
> }
8080
81-
这是 fpdf 徽标(内联):![来自 https://github.com/go-pdf/fpdf/tree/master/image](../image/fpdf.png)
81+
这是 fpdf 徽标(内联):![来自 https://codeberg.org/go-pdf/fpdf/src/branch/main/image](../image/fpdf.png)
8282

8383
这是一个地鼠:
8484

@@ -87,4 +87,4 @@
8787
* Go gopher 由 Renee French 设计。 Gopher 角色设计在知识共享 3.0 署名许可下获得许可。阅读 http://blog.golang.org/gopher 了解更多详情。*
8888

8989

90-
__这是文档的最后一行。__
90+
__这是文档的最后一行。__

cmd/md2pdf/russian.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The below is a blockquote with inner codeblocks.
8383
> return "working";
8484
> }
8585
86-
Here is the fpdf logo (inline): ![from https://github.com/go-pdf/fpdf/tree/master/image](../../image/fpdf.png)
86+
Here is the fpdf logo (inline): ![from https://codeberg.org/go-pdf/fpdf/src/branch/main/image](../../image/fpdf.png)
8787

8888
Here is a Gopher:
8989

cmd/md2pdf/test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The below is a blockquote with inner codeblocks.
7878
> return "working";
7979
> }
8080
81-
Here is the fpdf logo (inline): ![from https://github.com/go-pdf/fpdf/tree/master/image](../../image/fpdf.png)
81+
Here is the fpdf logo (inline): ![from https://codeberg.org/go-pdf/fpdf/src/branch/main/image](../../image/fpdf.png)
8282

8383
Here is a Gopher:
8484

containers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Markdown to PDF Converter
3-
* Available at http://github.com/mandolyte/mdtopdf
3+
* Available at http://github.com/solworktech/md2pdf
44
*
55
* Copyright © Cecil New <cecil.new@gmail.com>, Jesse Portnoy <jesse@packman.io>.
66
* Distributed under the MIT License.
@@ -14,7 +14,7 @@
1414
*
1515
* fpdf - a PDF document generator with high level support for
1616
* text, drawing and images.
17-
* Available at https://github.com/go-pdf/fpdf
17+
* Available at https://codeberg.org/go-pdf/fpdf
1818
*/
1919

2020
package mdtopdf

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module github.com/mandolyte/mdtopdf/v2
33
go 1.23.0
44

55
require (
6+
codeberg.org/go-pdf/fpdf v0.11.1
67
github.com/canhlinh/svg2png v0.0.0-20201124065332-6ba87c82371f
78
github.com/gabriel-vasile/mimetype v1.4.8
8-
github.com/go-pdf/fpdf v0.9.0
99
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b
1010
github.com/jessp01/gohighlight v0.21.2
1111
golang.org/x/exp v0.0.0-20240707233637-46b078467d37

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
codeberg.org/go-pdf/fpdf v0.11.1 h1:U8+coOTDVLxHIXZgGvkfQEi/q0hYHYvEHFuGNX2GzGs=
2+
codeberg.org/go-pdf/fpdf v0.11.1/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU=
13
github.com/canhlinh/svg2png v0.0.0-20201124065332-6ba87c82371f h1:Km7aXA1/+77OZ6mq8VV/QJ9nP6y4OUwxj+GQ5nW7X5Y=
24
github.com/canhlinh/svg2png v0.0.0-20201124065332-6ba87c82371f/go.mod h1:u13M4umOwLc1fTX2itKxGff/6S+YWc7l15kJGtm2IJY=
35
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
46
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
57
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
68
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
79
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
8-
github.com/go-pdf/fpdf v0.9.0 h1:PPvSaUuo1iMi9KkaAn90NuKi+P4gwMedWPHhj8YlJQw=
9-
github.com/go-pdf/fpdf v0.9.0/go.mod h1:oO8N111TkmKb9D7VvWGLvLJlaZUQVPM+6V42pp3iV4Y=
1010
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b h1:EY/KpStFl60qA17CptGXhwfZ+k1sFNJIUNR8DdbcuUk=
1111
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
1212
github.com/jessp01/gohighlight v0.21.2 h1:radLDWQMJeDwzn6b8cduio7kVXhy3zkYFsWxkr/3CRI=

highlight

mdtopdf.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Markdown to PDF Converter
3-
* Available at http://github.com/mandolyte/mdtopdf
3+
* Available at http://github.com/solworktech/md2pdf
44
*
55
* Copyright © Cecil New <cecil.new@gmail.com>, Jesse Portnoy <jesse@packman.io>.
66
* Distributed under the MIT License.
@@ -14,7 +14,7 @@
1414
*
1515
* fpdf - a PDF document generator with high level support for
1616
* text, drawing and images.
17-
* Available at https://github.com/go-pdf/fpdf
17+
* Available at https://codeberg.org/go-pdf/fpdf
1818
*/
1919

2020
// Package mdtopdf converts markdown to PDF.
@@ -30,7 +30,7 @@ import (
3030

3131
"strings"
3232

33-
"github.com/go-pdf/fpdf"
33+
"codeberg.org/go-pdf/fpdf"
3434
"github.com/gomarkdown/markdown"
3535
"github.com/gomarkdown/markdown/ast"
3636
"github.com/gomarkdown/markdown/parser"
@@ -456,9 +456,9 @@ func (r *PdfRenderer) UpdateBlockquoteStyler() {
456456
}
457457

458458
func (r *PdfRenderer) setStyler(s Styler) {
459-
// see https://github.com/mandolyte/mdtopdf/issues/18#issuecomment-2179694815
459+
// see https://github.com/solworktech/md2pdf/issues/18#issuecomment-2179694815
460460
// This does not address the root cause
461-
// (https://github.com/mandolyte/mdtopdf/issues/18#issuecomment-2179694815)
461+
// (https://github.com/solworktech/md2pdf/issues/18#issuecomment-2179694815)
462462
// but it will correct all cases and is safer.
463463
if s.Style == "bb" {
464464
s.Style = "b"

0 commit comments

Comments
 (0)