Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image is not displayed #272

Open
m-calapatapu opened this issue Jul 1, 2020 · 7 comments
Open

Image is not displayed #272

m-calapatapu opened this issue Jul 1, 2020 · 7 comments

Comments

@m-calapatapu
Copy link

m-calapatapu commented Jul 1, 2020

Image is not displayed when the html string contains the image url with alt when loading into editorView. but when I to manually insert image with URL and Alt from tool bar able to see the image.
Please give a solution on this ASAP

@m-calapatapu
Copy link
Author

m-calapatapu commented Jul 1, 2020

Can anyone please respond why? WkWebview is not loading below image
img alt="Sample" src="https://docint0.blob.core.windows.net/publicfilescontainer02/" width="582" style="padding-bottom: 0px; vertical-align: bottom; border: 0px; outline: none; text-decoration: none; display: inline;" class="gmail-m_4922265757032371696mcnImage

@yegail
Copy link

yegail commented Jul 6, 2020

https://docint0.blob.core.windows.net/publicfilescontainer02/
this image not accessible

@m-calapatapu
Copy link
Author

https://docint0.blob.core.windows.net/publicfilescontainer02/
this image not accessible

For security reason I edited the URL. not to access. you can use any image URL in that place. The real image works when used in browser.
Please give some solution on this issue

@nnhubbard
Copy link
Owner

If you toggle the source view, it seems iOS is inserting smart quotes. Not sure why, don't have a chance to investigate.

@m-calapatapu
Copy link
Author

Can you please give me a solution to handle it. As displaying the image is the major part in my App.

@m-calapatapu
Copy link
Author

m-calapatapu commented Jul 10, 2020

I am able to display the image by changing the code of method removeQuotesFromHTML in ZSSRichTextEditor.m as below
-(NSString *)removeQuotesFromHTML:(NSString *)html {
html = [html stringByReplacingOccurrencesOfString:@""" withString:@"\""];
html = [html stringByReplacingOccurrencesOfString:@"“" withString:@""];
html = [html stringByReplacingOccurrencesOfString:@"”" withString:@""];
html = [html stringByReplacingOccurrencesOfString:@"\r" withString:@"\r"];
html = [html stringByReplacingOccurrencesOfString:@"\n" withString:@"\n"];
return html;
}
Don't know whether the fix is correct or not.

@AriqAhmad
Copy link

AriqAhmad commented Aug 7, 2020

I used the following and it's working for me:

 -(NSString *)removeQuotesFromHTML:(NSString *)html {
    html = [html stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"];
    html = [html stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
    html = [html stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
    html = [html stringByReplacingOccurrencesOfString:@"\r" withString:@""];
    return html;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants