Added text preview functionality.