LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
881 stars 335 forks source link

Editorjs #923

Open soverxxx opened 1 year ago

soverxxx commented 1 year ago

Hi, i see cool open-source project for content editor (post, comments, nevermind) Is https://editorjs.io/

Maybe you would consider integrating it into your project? The current editor has some usability issues. For example , such as:

dessalines commented 1 year ago

I'm not a fan of most of these tools that overtake textareas, because:

no line break when pressing Enter. -- instead of hyphenating, he just ignores it, he has to make a new paragraph, with a line omission.

Commonmark markdown requires two line breaks for a new paragraph. And why would your enter key not work?

or a problem with the lack of visibility of real-time changes.

You do have to click the preview button to see the rendered markdown. Some editors do the side-by-side, and some really advanced ones try to render a hybrid inline in some way, in a WYSIWYG type mode. To be as cross-platform as possible, we just use a textarea with a preview button.

soverxxx commented 1 year ago

Commonmark markdown requires two line breaks for a new paragraph. And why would your enter key not work? Enter key worked in edito, but with a single click Enter, it creates a line break in the editor, but does not do it in the final version. This confuses the user and creates difficulties and troubles using the interface.

To be as cross-platform as possible, we just use a textarea with a preview button. Would you consider introducing any other WYSIWYG? All modern text input interfaces don't work like lemmy. This pushes away from content generation.

And what about embedding videos and other iframes? Have you removed it permanently? This is another minus in the piggy bank of content generation.

soverxxx commented 1 year ago

I understand your concern about bloating, but look at it from the other side.

This is not a detail, it is one of the basics of the application. The most important thing in sites like Lemmy or reddit is content. And the content is generated by ordinary ordinary users, it should be convenient and easy for them to do it. Frontend should not burden a person, everything should be intuitive for the end user.

elishamint commented 1 year ago

Enter key worked in edito, but with a single click Enter, it creates a line break in the editor, but does not do it in the final version. This confuses the user and creates difficulties and troubles using the interface.

It could actually make a good improvement to add a double space or a backspace automatically, on pressing enter. That's how markdown makes a single line break, but users first have to learn it.

Aloso commented 1 year ago

I would instead recommend Tiptap editor.

They're almost always bloated, usually more than the size of your application itself.

TipTap with the most common extensions weighs about 100kB minified (30kB gzipped). I think this can be justified with the improved UX. For comparison, Lemmy's client.js is currently 2.39MB large (755kB gzipped).

Also, we can make the rich text editor optional and import it dynamically, so only people who want to use it have to fetch it.

They don't match the styles / themes of your html.

TipTap doesn't have styles / themes, you add the buttons you need and style them yourself.

They aren't customizeable enough (we have things like custom spoiler tags, lots of markdown-it additions)

TipTap is very customizeable, and I would help implementing the extensions we need. It seems like the only markdown-it extensions not already supported by TipTap are spoilers and footnotes.

One challenge would be to convert the formatted text to Markdown. But it is definitely possible – TipTap can return the document's internal representation as an object.