React-native-gifted-chat: Handling html inside messages

Created on 25 Jun 2017  路  2Comments  路  Source: FaridSafi/react-native-gifted-chat

Issue Description

I have an existing messaging app which allows mentions and uses html to highlight mentionned user names. When I plug the messages into Gifted Chat, they look like this :

Yo <span class="editor-suggestion suggestion-user" data-original-suggestion-text="Albert Einstein" data-suggestion-type="user" data-suggestion-user-id="529628cbe4b041ef4c83ad33">Albert Einstein</span>&nbsp;how are you man

How can I convert this string to html so it's displayed properly ?

Steps to Reproduce / Code Snippets

Have strings containing html elements in your messages

Expected Results

I should see:

Yo Albert Einstein how are you man

Additional Information

  • React Native version: latest
  • react-native-gifted-chat version: latest
  • Platform(s) (iOS, Android, or both?): both

Most helpful comment

@nonotest are there examples for this or something?

All 2 comments

you can try to wrap message text in renderMessageText with an html render like https://github.com/jsdf/react-native-htmlview and pass it relevant styles

@nonotest are there examples for this or something?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pentarex picture pentarex  路  3Comments

tafelito picture tafelito  路  3Comments

yazhengwang picture yazhengwang  路  3Comments

Fr33maan picture Fr33maan  路  3Comments

cerberusv2px picture cerberusv2px  路  3Comments