Fixed whitespace replace in text content

improved regex and added tests for text method
Merge pull request #1 from hkdobrev/text-whitespace

Fixed whitespace replace in text content