nnhubbard / ZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
MIT License
3.78k stars 584 forks source link

loading a long html, it will make app freeze #281

Open yihuds opened 3 years ago

yihuds commented 3 years ago

when we load a HTML with long content, app will become freeze and then killed by iOS system.

nnhubbard commented 2 years ago

This sounds like an issue with WKWebView.

101airborne commented 1 year ago

I had a similar issue. I found that HTML with a lot of formatting appeared to hang my mac catalyst app, but found it was actually just taking an extremely long time. On debugging the issue I found that the culprit was CYRTextView.h/m which is a subclass of UITextView. It is the class used for the text view of the HTML, sourceView. My local fix was to make sourceView's class UITextView instead of CYRTextView.

// // ZSSTextView.h // ZSSRichTextEditor // // Created by Nicholas Hubbard on 1/29/14. // Copyright (c) 2014 Zed Said Studio. All rights reserved. //

import "CYRTextView.h"

// Fix Issue #010 - "Extremely slow opening note copied/pasted from // web page". Eliminate the syntax formatting of the HTML that was // causing the very slow note loading. Remove CYRTextView subclassing // of UITextView. The "Show Source" tool will now display unformatted, // unsyntaxed HTML. //@interface ZSSTextView : CYRTextView @interface ZSSTextView : UITextView

@property (nonatomic, strong) UIFont defaultFont; @property (nonatomic, strong) UIFont boldFont; @property (nonatomic, strong) UIFont *italicFont;

@end