botmasterai / botmaster-watson-conversation-ware

Botmaster middleware for Watson Conversation
MIT License
13 stars 5 forks source link

How to .replace(/<br>/g, '\n'); #6

Closed ghost closed 7 years ago

ghost commented 7 years ago

How to replace BR code globally to \n using .replace(/BR/g, '\n') ?

By using the botmaster-watson-conversation-ware, I could make the FB bot with Watson,

But I can not find the way to replace all the BR globally to \n in the watson output text which will be given to users.

Is it related with the 'update.watsonUpdate.output.text' ?

Thanks,

P.S. Since the BR code is just applied in this example so I change the real BR code to just BR so please check the issue title.

ghost commented 7 years ago

Using update.watsonUpdate.output.text[i].replace(/
/g, '\n'), the issue has been solved.