Make generating text use the same functionality as DOM since it could generate DOM when it receives a SafeString, catch fatal bug turning all text to DOM or all DOM to text.