user2718956
user2718956

Reputation: 21

UIWebview with contenteditable - superscript and subscript NOT work

I have webview with contenteditable and use javascript to do rich text editing. It works with some commands like "Bold" and "Italic" below:

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('Bold')"];

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('Italic')"];

But somehow "superscript" and"subscript" below, it doesn't work:

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('superscript')"];

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('subscript')"];

Anyone knows, under iOS, do we have similar Rich-Text Editing in Mozilla, so that I can know what commands will work under Safari-UIWebview?

Upvotes: 2

Views: 550

Answers (1)

Léo Natan
Léo Natan

Reputation: 57050

Just tested this page on my iOS7.1 iPad:

http://quirksmode.org/dom/execCommand/

Both superscript and subscript work. Looking at the source, the following command is performed: document.execCommand("superscript", false, null);

Upvotes: 1

Related Questions