Strip the line to filter lines composed of only whitespaces

Fix #9395
Merge pull request #9805 from mscherer/fix_9395

Strip the line to filter lines composed of only whitespaces