ZSSRichTextEditor
ZSSRichTextEditor copied to clipboard
Inserting link doesn't work
When inserting a link it outputs 'insert link' in the console, however no link is getting inserted in the text area. That might be related to #95.
I'm experiencing this too.
I have just tried replicating this issue and it is working for me.
@michaelloistl @obuseme I am going to close this issue for now but if you can provide clear steps to reproduce this issue and I am able to reproduce it then I will re-open it.
I'm experiencing this too.
I solved . First call [self.editorView stringByEvaluatingJavaScriptFromString:@"zss_editor.prepareInsert();"];
This is still an issue. I fixed similar to menuhui22's fix, by inserting:
// Save the selection location [self.editorView evaluateJavaScript:@"zss_editor.prepareInsert();" completionHandler:^(NSString *result, NSError *error) { }];
at beginning of:
- (void)insertLink:(NSString *)url title:(NSString *)title
@101airborne Please submit a pull request if you have fixed this issue.
I'm sorry but I am not in a position to do a pull request, but here is the entire changed -insertLink:url:title function: `- (void)insertLink:(NSString *)url title:(NSString *)title {
// Save the selection location, preparing for insert - resolves ISSUE #104
[self.editorView evaluateJavaScript:@"zss_editor.prepareInsert();" completionHandler:^(NSString *result, NSError *error) {
}];
NSString *trigger = [NSString stringWithFormat:@"zss_editor.insertLink(\"%@\", \"%@\");", url, title];
[self.editorView evaluateJavaScript:trigger completionHandler:^(NSString *result, NSError *error) {
}];
if (_receiveEditorDidChangeEvents) {
[self updateEditor];
}
} `