trim title and content to avoid empty string input