Use the selected text format to filter the user's input