Skip to content
This repository was archived by the owner on Dec 13, 2017. It is now read-only.

Commit 7283de5

Browse files
committed
Merge branch 'develop' into feature/ios_10_fixes
2 parents 91f7bf6 + 44cbcdd commit 7283de5

7 files changed

Lines changed: 28 additions & 12 deletions

File tree

Assets/ZSSRichTextEditor.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,20 @@ ZSSEditor.init = function(callbacker, logger) {
105105
}, false);
106106

107107
$('[contenteditable]').on('paste',function(e) {
108-
// Ensure we only insert plaintext from the pasteboard
109108
e.preventDefault();
110-
var plainText = (e.originalEvent || e).clipboardData.getData('text/plain');
111-
if (plainText.length > 0) {
109+
110+
var clipboardData = (e.originalEvent || e).clipboardData;
111+
112+
// If you copy a link from Safari using the share sheet, it's not
113+
// available as plain text, only as a URL. So let's first check for
114+
// URLs, then plain text.
115+
// Fixes https://github.com/wordpress-mobile/WordPress-Editor-iOS/issues/713
116+
var url = clipboardData.getData('text/uri-list');
117+
var plainText = clipboardData.getData('text/plain');
118+
119+
if (url.length > 0) {
120+
document.execCommand('insertText', false, url);
121+
} else if (plainText.length > 0) {
112122
document.execCommand('insertText', false, plainText);
113123
} else {
114124
//var joinedArguments = ZSSEditor.getJoinedFocusedFieldIdAndCaretArguments();

Classes/WPEditorField.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,13 @@ - (NSString *)addSlashes:(NSString *)html
245245
html = [html stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
246246
html = [html stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"];
247247
html = [html stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
248-
248+
249+
// Invisible line separator and paragraph separator characters.
250+
// Fixes https://github.com/wordpress-mobile/WordPress-iOS/issues/5496 and
251+
// https://github.com/wordpress-mobile/WordPress-Editor-iOS/issues/830
252+
html = [html stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"];
253+
html = [html stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"];
254+
249255
return html;
250256
}
251257

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- CocoaLumberjack/Extensions (2.2.0):
99
- CocoaLumberjack/Default
1010
- NSObject-SafeExpectations (0.0.2)
11-
- WordPress-iOS-Editor (1.6.1):
11+
- WordPress-iOS-Editor (1.7):
1212
- CocoaLumberjack (~> 2.2.0)
1313
- NSObject-SafeExpectations (~> 0.0.2)
1414
- WordPressCom-Analytics-iOS (~> 0.1.0)
@@ -29,7 +29,7 @@ EXTERNAL SOURCES:
2929
SPEC CHECKSUMS:
3030
CocoaLumberjack: 17fe8581f84914d5d7e6360f7c70022b173c3ae0
3131
NSObject-SafeExpectations: 7d7f48df90df4e11da7cfe86b64f45eff7a7f521
32-
WordPress-iOS-Editor: 9daa51cb32ee0c2821045c1035e925eb3c6633ed
32+
WordPress-iOS-Editor: 973cfd00f5ceea89d9337ae7be7c59144931edef
3333
WordPress-iOS-Shared: 50a7bd7056b8721e86c3cbe167eab49ef85ec07b
3434
WordPressCom-Analytics-iOS: a844ac791b2627dbb64ba62090654f43dd2abc1c
3535

Example/Pods/Local Podspecs/WordPress-iOS-Editor.podspec.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/WordPress-iOS-Editor/Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WordPress-iOS-Editor.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPress-iOS-Editor"
3-
s.version = "1.6.1"
3+
s.version = "1.7"
44
s.summary = "Reusable component rich text editor for WordPress.com in an iOS application."
55

66
s.description = <<-DESC

0 commit comments

Comments
 (0)