Skip to content

Commit

Permalink
fix: allow empty HTML body with an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb committed May 25, 2024
1 parent 26718f4 commit 89c8bdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wp2hugo/internal/hugogenerator/hugopage/hugo_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ func (page *Page) writeMetadata(w io.Writer) error {

func (page *Page) getMarkdown(provider ImageURLProvider, htmlContent string) (*string, error) {
if htmlContent == "" {
return nil, fmt.Errorf("empty HTML content")
log.Error().
Any("page", page.metadata).
Msg("Empty HTML body for page")
msg := ""
return &msg, nil
}
converter := getMarkdownConverter()
htmlContent = improvePreTagsWithCode(htmlContent)
Expand Down

0 comments on commit 89c8bdd

Please sign in to comment.