mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-20 16:22:49 +00:00
fix parsing of pandoc result
This commit is contained in:
parent
aaed290b02
commit
35461c167f
|
@ -195,9 +195,9 @@ func (a *pandocConverter) extractTOC(src []byte) ([]byte, tableofcontents.Root,
|
|||
if err != nil {
|
||||
return nil, tableofcontents.Root{}, err
|
||||
}
|
||||
// ltrim <html><head></head><body> and rtrim </body></html> which are added by html.Render
|
||||
res := buf.Bytes()[6:]
|
||||
res = res[:len(res)-7]
|
||||
// ltrim <html><head></head><body>\n\n and rtrim \n\n</body></html> which are added by html.Render
|
||||
res := buf.Bytes()[8:]
|
||||
res = res[:len(res)-9]
|
||||
return res, toc, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue