Fix the content ordering of the TOC for diffs

The table of contents in diff view were not sorting correctly. We saw: 

appendix h, appendix i, supplement i, appendix j

when we should see: 

appendix h, appendix i, appendix j, ..., supplement i

This fixes the sorting.