html - Content Editable Text Editors -


i have tried out several html editors including tinymce, ckeditor , nicedit. nicedit in 1 respect - easy customize. however, have found have tendency produce poor html. not because don't correctly interpret invalid user actions such attempting style without first having made selection.

it far easy end html contains like

<span style='color:#ff0000'><span style='color:#ff0000'><span style='color:#ff0000'>red</span></span></span> 

am right in thinking pretty limitation of content editable concept? poor html not matter if purpose email or posts on forums such gets rather uncomfortable live if generated html has used in context of web page. if of right alternatives? perhaps flash based plugin editor produces better html , works harder @ interpreting user wants do?

i suppose in principle possible study generated output , clean out between concertina'd spans if required liable quite undertaking.

at beginning should mention i'm ckeditor core developer, opinion may not objective :).

the state of html editing afaik hasn't changed last few years. browsers vendors have spent little time fixing bugs - little of oldest bugs on ckeditor trac caused browser issues still valid , of hacks we've ever created still required. , don't mean ie 7 or 8 still support, because in fact ies may not worst. haven't checked precisely, think general improvements dom apis in recent ies versions may require less hacks other browsers, because editing support seems stable , complete. e.g. ugliest hack ever needed webkit browsers (see: webkit bug , closed ckeditor ticket) , bug 5 year old. what's more - isn't edge case or unlikely scenario - issue makes impossible create whole range of selections - e.g. inside empty inline element iirc.

so, unlike web technologies in general, html editing stands left 10 years ago. same bugs, same missing features, same... markup. guess created fontname command? <font face=""> - yep, not joking. @ least browsers consistent here... consistency disappears.

what spec? there's draft, not @ - standardizes current state, know not well. , afaics, draft dead.

and there's 1 more thing worries me - direction in editing goes. google uses contenteditable in gmail (no, google docs not built on contenteditable), not care html output. apple reuses html editing component in email app ios , perhaps in mail macos (because see same specific behaviours). mozilla reuses gecko in thunderbird , wouldn't surprised if microsoft same in outlook. of them not care html output. these engines made understand every crap rather fix , html editing draft it.

thanks of that, can see new issues this one. in blink/webkit bug report summarized whole range of incorrect (from our pov - devs care html) results when pressing backspace. designed nice (although not), html , editing apis not important.

i don't care this. need editor!

the solution of fixing after browsers and/or replace native implementations our own. last 1.5 years i've been working exclusively on filtering , normalizing input , output. in ckeditor 4.0 rewrote entire pasting , html insertion processes , in released ckeditor 4.1 introduced advanced content filter adapts input data editor configuration. less features enabled, less allowed in html. check this sample - try paste/write/create crappy html.

of course, there's still room improvements. e.g. not able filter data during editing. if browser (like webkit) creates mess can fix on output, in fact haven't decided because filtering complex process , spoil performance. limit input , user actions 1 day implement our own backspace/delete handlers prevent browsers messing our html. that's solution , why there 2 or 3 wysiwyg editors.

anyway, nothing has changed in browsers' html editing implementations, lot has changed in wysiwyg editors world. advice check them again if base on experience few years back.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -