I actually started a simple WYSIWYG editor that doesn't use contentEditable but instead a tiny subset of HTML and some virtual DOM like technology. Thanks for this post. It makes me want to work more on it!
Pell – A simple and small rich-text editor for the web
51–60 of 106 posts
Re: Pell – A simple and small rich-text editor for the web
#52Earlier quoted context omitted.
Accurately rendering text in an WYSIWYG HTML editor has equivalent difficulty to implementing the engine used in the web browser that will eventually be used to render that HTML, otherwise it can never truly be WYSIWYG
That's fair, I'm obviously biased by my general loathing of WYSIWYG editors but clearly I'm in the minority here. I guess when I think about text editors I think mainly of code editors.
Re: Pell – A simple and small rich-text editor for the web
#53This is cool :) That said (and not to take thunder away from your page), this is possible because the HTML spec itself allows for any element to be made into a "WYSIWYG" editor by adding the "contenteditable" attribute. What most other larger editors are doing is working around some of the horrendous non-standardized versions of execCommand which varies across browsers. Ideally a web standards body should come out wi…
IF this ever came about (big if) it should support native conversion between markdown / html and other formats. That stuff is a nightmare
Re: Pell – A simple and small rich-text editor for the web
#54Earlier quoted context omitted.
I doubt this? contenteditable is pretty stable in Chrome/WebKit.
I don't know - you tell me. Anyway we had our share of trouble with a customer due to an exotic rendering issue that occurred in two consecutive versions of Chrome and then disappeared, so yeah.
I'd say it's the exception and not the rule, though.
Re: Pell – A simple and small rich-text editor for the web
#55As another alternative, I used SimpleMDE ( https://simplemde.com/ ) for IPFessay ( https://gitlab.com/stavros/IPFessay ), and, while not this light, it's pretty good and featureful. It doesn't expose all the features I'd like it to expose, but I'm quite satisfied by it.
Re: Pell – A simple and small rich-text editor for the web
#56This is cool :) That said (and not to take thunder away from your page), this is possible because the HTML spec itself allows for any element to be made into a "WYSIWYG" editor by adding the "contenteditable" attribute. What most other larger editors are doing is working around some of the horrendous non-standardized versions of execCommand which varies across browsers. Ideally a web standards body should come out wi…
> IF this ever came about (big if) it should support native conversion between markdown / html and other formats. That stuff is a nightmare
Re: Pell – A simple and small rich-text editor for the web
#57Earlier quoted context omitted.
Which means you end up shipping a huge chunk of "bloat" to your end users - it may be a library or "runtime" rather than your own code, but it adds up to the same thing.
so in that case isn't it a good idea to try and reduce your overheads wherever possible? And in the case of windows store apps, the runtime is already on the users systems and they're just downloading the packaged JS/HTML
I think it's the opposite: if you're using react-native or electron you might as well give up on optimizing the size of your own code, because it's not going to make a dent in your overall level of bloat. Enabling your codebase to be used from the user's own browser would have a much better return in bloat-reduction, even if it meant writing more of your own code.
> And in the case of windows store apps, the runtime is already on the users systems and they're just downloading the packaged JS/HTML
Sure, but making your site windows-store-only is morally the same thing as making it single-browser (possibly even single-version-of-that-browser). The flip side of "all that "bloat" is there so that you'll get consistent results across browsers" is that you can cut a lot of bloat if you're willing to sacrifice crossplatform support.
Re: Pell – A simple and small rich-text editor for the web
#58It's great that it's small, but it suffers from the same horrible interactions that most other web editors also suffer from. Try quoting the last paragraph in the editor. It's now impossible to ever escape from the quote. All new text at the bottom stays "quoted". From a cursory test of the editor, it suffers from basically all the issues that contenteditable suffers from. The reason other editors are so big is becau…
Re: Pell – A simple and small rich-text editor for the web
#59I'd like to mention a few things about pell.js and it's goals:
- It was not made to be the most full-featured editor out there
- It was not made to fight with or worry about browser inconsistencies (browsers are converging, quickly too)
- It was made to demonstrate the underlying simplicity of something that looks like magic to most beginner developers (including myself) and to teach people how to use `contentEditable` and `execCommand` via a tiny, extremely readable codebase
- It was made for people who need just a basic WYSIWYG editor in their app/site/whatever and who care about bundle size (PWA's anyone?)
Over time, many of the inconsistencies and issues will get fixed or implemented in pell, but the goal of remaining tiny yet functional will always remain paramount.
Re: Pell – A simple and small rich-text editor for the web
#60I am impressed by both the size and the features and no dependencies. Kinda like a gui linux under 20 MB. People need to do such similar things instead of a huge bloated single page web app with features that nobody want. Great project.