Fix some markdown output issues

master
r4 2 years ago
parent 72915c2de7
commit f309c62d5a
  1. 5
      go.mod
  2. 4
      main.go

@ -2,4 +2,7 @@ module projekt_gutenberg_de_dl
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
)

@ -241,7 +241,7 @@ func (e *Extractor) parseAdditionalPage(doc *gq.Document) error {
// Transform the individual HTML elements.
switch n.DataAtom {
case atom.Br:
ret = "\n"
ret = "\n\n"
case atom.H1:
ret = "# " + processChildren() + "\n"
case atom.H2:
@ -318,7 +318,7 @@ func (e *Extractor) FetchAndProcessChapter(chapterUrl string) error {
}
// Add horizontal rule after title page.
if path.Base(chapterUrl) == "titlepage.html" {
fmt.Fprintln(e.W, "----------------")
fmt.Fprintln(e.W, "\n----------------\n")
}
return nil
}

Loading…
Cancel
Save