diff --git a/internal/merge.go b/internal/merge.go index 9b5240e..c9b7431 100644 --- a/internal/merge.go +++ b/internal/merge.go @@ -69,13 +69,13 @@ func Merge(base, doc io.Reader) (merged string, assets *Assets, _ error) { func merge(base, doc *html.Node) (out *html.Node) { out, err := html.Parse(strings.NewReader("")) if err != nil { - panic("mergehtml: internal error: " + err.Error()) + panic("merge: internal error: " + err.Error()) } // TODO: title html := find(out, atom.Html) if html == nil { - log.Panicf("no in %v", out) + log.Panicf("merge: no in %v", out) } head := find(html, atom.Head) reparentChildren(head, find(find(base, atom.Html), atom.Head)) @@ -83,12 +83,12 @@ func merge(base, doc *html.Node) (out *html.Node) { body := find(html, atom.Body) if body == nil { - log.Panicf("no in %v", html) + log.Panicf("merge: no in %v", html) } baseBody := find(find(base, atom.Html), atom.Body) newBody := find(find(doc, atom.Html), atom.Body) - reparentChildren(body, baseBody) + header := findRec(body, atom.Header) footer := findRec(body, atom.Footer) main := findRec(body, atom.Main)