Fix some markdown output issues
This commit is contained in:
parent
72915c2de7
commit
f309c62d5a
5
go.mod
5
go.mod
@ -2,4 +2,7 @@ module projekt_gutenberg_de_dl
|
|||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require github.com/PuerkitoBio/goquery v1.7.1
|
require (
|
||||||
|
github.com/PuerkitoBio/goquery v1.7.1
|
||||||
|
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
|
||||||
|
)
|
||||||
|
4
main.go
4
main.go
@ -241,7 +241,7 @@ func (e *Extractor) parseAdditionalPage(doc *gq.Document) error {
|
|||||||
// Transform the individual HTML elements.
|
// Transform the individual HTML elements.
|
||||||
switch n.DataAtom {
|
switch n.DataAtom {
|
||||||
case atom.Br:
|
case atom.Br:
|
||||||
ret = "\n"
|
ret = "\n\n"
|
||||||
case atom.H1:
|
case atom.H1:
|
||||||
ret = "# " + processChildren() + "\n"
|
ret = "# " + processChildren() + "\n"
|
||||||
case atom.H2:
|
case atom.H2:
|
||||||
@ -318,7 +318,7 @@ func (e *Extractor) FetchAndProcessChapter(chapterUrl string) error {
|
|||||||
}
|
}
|
||||||
// Add horizontal rule after title page.
|
// Add horizontal rule after title page.
|
||||||
if path.Base(chapterUrl) == "titlepage.html" {
|
if path.Base(chapterUrl) == "titlepage.html" {
|
||||||
fmt.Fprintln(e.W, "----------------")
|
fmt.Fprintln(e.W, "\n----------------\n")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user