ZSSRichTextEditor icon indicating copy to clipboard operation
ZSSRichTextEditor copied to clipboard

Image is not displayed

Open m-calapatapu opened this issue 4 years ago • 7 comments

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 avatar Jul 01 '20 06:07 m-calapatapu

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

m-calapatapu avatar Jul 01 '20 12:07 m-calapatapu

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

yegail avatar Jul 06 '20 08:07 yegail

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

m-calapatapu avatar Jul 06 '20 08:07 m-calapatapu

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

nnhubbard avatar Jul 06 '20 16:07 nnhubbard

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

m-calapatapu avatar Jul 09 '20 04:07 m-calapatapu

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.

m-calapatapu avatar Jul 10 '20 11:07 m-calapatapu

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;
}

AriqAhmad avatar Aug 07 '20 08:08 AriqAhmad