Skip to content

Commit

Permalink
fix parsing of pandoc result
Browse files Browse the repository at this point in the history
  • Loading branch information
pagdot committed Oct 6, 2022
1 parent aaed290 commit 35461c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions markup/pandoc/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 35461c1

Please sign in to comment.