I am implementing a rich text editor in a webView (contentEditable set to true). To stylize the text I am using following command:
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"PLACEHOLDER\")"];
where PLACEHOLDER can be Bold, Italic, Underline etc.
The problem is I want to implement headings as well but they are not working this way. Maybe the webView doesn’t support headings. I don’t know exactly. How can I incorporate headings control in my rich text editor?
Found out a way around for that. I hope it would be helpful for someone like me. The correct code for that is :