helper function - parse raw user input - chat_ui.js