ZSSRichTextEditor icon indicating copy to clipboard operation
ZSSRichTextEditor copied to clipboard

formatting not working in iOS 11.

Open clement89 opened this issue 8 years ago • 1 comments

This happens when we edit the document. The issue is related to iOS 11. In iOS 11 they added "Smart Punctuation" to the keyboard settings. This means when typing “Clement” it will convert it to “Clement”. The '"' are replaced by a '“' and '”' string. These are different quotes (smart quotes)was the reason for malfunctioning... I try fixing the issue by replacing

html = [html stringByReplacingOccurrencesOfString:@"“" withString:@"""];
html = [html stringByReplacingOccurrencesOfString:@"”" withString:@"""];

with

html = [html stringByReplacingOccurrencesOfString:@"“" withString:@"\\\""];
html = [html stringByReplacingOccurrencesOfString:@"”" withString:@"\\\""];

in "removeQuotesFromHTML" function in ZSSRichTextEditor.m

clement89 avatar Feb 27 '18 07:02 clement89

I encountered the same problem (loss of formatting) of a previously edited and saved document on the iOS target of my Catalyst app. At the same time the macOS target worked perfectly without losing formatting.

I too tracked the problem down to smart quotes and the -removeQuotesFromHTML function in ZSSRichTextEditor.m. But, the exact solution eluded me until I found this Issue posting. The fix works for me. Thanks clement89!

101airborne avatar Oct 13 '21 16:10 101airborne