jsdf/react-native-htmlview

How can I add a src to image tag

mohamedshuaau opened this issue · 1 comments

So Currently I am using tinymce to write and save the data to the tables. And the images with img tags looks like this: <img src="/images/test.png" /> Now how can I append the server ip or something before the /images?

I took the example from the official page and this is how mine looks like.

const parsedMessage = this.state.message_detail;
<HTMLView
   value={parsedMessage}
   stylesheet={styles}
/>

Solved. For anyone looking for the solution, this is not the best way to do this obviously but here is what I did. I went in to the htmlToElement.js file and edited this line:

const source = {
    uri: baseURL.baseAppURL + props.attribs.src,
    width,
    height,
  };

My baseURL.js file looks like this:

const baseURL = {
    baseAppURL: 'http://192.168.1.5/MyApplication/public/'
};

export default baseURL;

I am using laravel as a backend. Hope this helps someone