Add a test case for those, and refactor bits of the wrap highlighter. This explains part of the needed complexity in #2820.