Skip to content

Commit

Permalink
Fixed h1 with only an image being cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jan 25, 2018
1 parent a4dea55 commit 26fc1d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kepub/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ func cleanHTML(doc *goquery.Document) error {

// Remove empty headings
doc.Find(`h1,h2,h3,h4,h5,h6`).FilterFunction(func(_ int, s *goquery.Selection) bool {
return strings.Trim(s.Text(), "\t \n") == ""
h, _ := s.Html()
return strings.Trim(h, "\t \n") == ""
}).Remove()

// Remove MS <st1:whatever> tags
Expand Down

0 comments on commit 26fc1d2

Please sign in to comment.