Respect the hash with sub headings

Add tests so we don't break this again

Bug: 64918
Change-Id: Ic376efa8b6efec84aef45660104e5c25eada5b30
Merge "Respect the hash with sub headings"