Fix finding views with line breaks.

This fixes #265 and #267. It also takes into account the ideas bnickel
stated out in #267.
Merge pull request #404 from plu/issue-265

Fix finding views with line breaks.