Fix finding views with line breaks.

This fixes #265 and #267. It also takes into account the ideas bnickel
stated out in #267.

I ran the test suite for 6.1, 7.0 and 7.1.