Correctly skip empty document-text chunks

This patch makes filter out stuff having `nodeType` 3 and `data` equal to " ". It's especially important when it comes to `after` element – empty text chunks appear to capture the `after` container making it show up after the last tag and not inside of it.