6 ms·
Nonsense, I've written a much smaller one: `function tinyEditor(element) { element.contentEditable = true }` That, plus a few crude buttons, is all this does.
by marijn 9y ago
Nonsense, I've written a much smaller one: `function tinyEditor(element) { element.contentEditable = true }`
That, plus a few crude buttons, is all this does. As several other comments point out, there's good reasons why real WYSIWYG packages are bigger—the user experience of working with a plain contentEditable element is still terrible, the output HTML still a complete mess. If you don't care much about that, you don't need an editor component, since setting an attribute and wiring up some buttons to call `execCommand` is easy enough to do from scratch.
Disclaimer: I work on one of those 'bloated' editors, http://prosemirror.net http://prosemirror.net , and find it a little annoying when someone implies their crude afternoon hack is somehow equivalent and we're crazy for putting in all that effort.
- veli_joza 9y agoEven as beginner in web tech, I was convinced of the same after glancing at the code. There's probably more project packaging description LoC than logic code, so SNR is quite low.
- anilgulecha 9y agoThanks for prosemirror, marijn! Big fan :)
- laktek 9y agoCame here to post about ProseMirror, glad you commented :)
- ctrlrsf 9y ago@marijn On prosemirror.net home page, typing "#<space>" in the sample editor seems to break it.
- nvr219 9y agosnap
- marijn 9y agoGood point -- I had some CSS attached to H1 nodes that accidentally also matched H1s in the editor. Should be fixed now.
- sk5t 9y agoAlso note, some of the tooltips appear as "undefined" and there's no way to advance the cursor past a horizontal rule at the end of the document.
- jaredreich 9y agoThe last thing I want for notable developers of high quality WYSIWYG editors is to get upset. Take this with a grain of salt. Continue doing the great things you do with ProseMirror and your other valuable open source contributions. But don't get upset. Try getting inspired, to move with the times, to trust browsers more, to make YOUR projects smaller, lighter, and easier to use. P.S. Just because something is small, doesn't mean it's a crude afternoon hack :)
- krat0sprakhar 9y ago> The last thing I want for notable developers of high quality WYSIWYG editors is to get upset. While I'm certain you have good intentions, the size comparison chart at the top of the README is a bit misleading. It would be fair to list out the trade-offs on going ahead with ContentEditable so that users can know what they are getting if they choose Pell. To clarify, Pell looks awesome and I don't intend to diss on your project or your hard work, just that the way the project's README is laid out I feel @marijn's response is not totally unwarranted.
- emodendroket 9y agoI mean, the post you're replying to gives reasons why they didn't take that approach, and this reply seems vaguely insulting.
- shaunxcode 9y agoDo you genuinely believe he has not explored that approach? How is one meant to get inspired by something they have already explored? Please don't be rude and wrong at the same time.
- usaphp 9y agoYour prosemirror homepage has a horizontal scroll bar when viewed from iPhone
- marijn 9y agoThanks for pointing that out. CSS is hard. Should be fixed now.
- inertial 9y agoProsemirror's logo reminds me of : https://dribbble.com/shots/2054672-Neg-Owl-4 https://dribbble.com/shots/2054672-Neg-Owl-4
- marijn 9y ago... more than a little, even. I'll talk to the designer of the logo.