Live data from Hacker News

Trix: A rich text editor for everyday writing

github.com

121–130 of 137 posts

Re: Trix: A rich text editor for everyday writing

#121
post #6
post #2

Since they didn't put a demo up on their site, here's one cobbled from their documentation: http://jsbin.com/cazewaxoje/1

I just added a demo: http://trix-editor.org/

@javen

You'll want to add "cursor: hand;" to your CSS when someone hovers over the styling buttons. Because right now, it default to the cursor point, which doesn't given a clue to the user that the styling buttons are clickable.

Re: Trix: A rich text editor for everyday writing

#122

Great timing, we were just looking for a new editor for our project. Since there are so many choices, here's a list of everything mentioned in this post. Trix - https://github.com/basecamp/trix - demo here: http://trix-editor.org/ by basecamp and used in v3, handles files/images well Squire - https://github.com/neilj/Squire - used in FastMail webmail, better for text than images ProseMirror - http://prosemirror.net/…

Since there are quality of life improvements that are often invisible at first sight, I'd like to point out a few ProseMirror hidden features:

- Typing "- " at the start of a line creates an unordered list, and typing "1. " creates an ordered list.

- Typing the '"' character correctly replaces it with the right unicode character, and you can undo that replacement by hitting backspace. The same goes with "--".

- It hints at automatic emoji insertion here: http://prosemirror.net/demo_dino.html

- Surprisingly, the keyboard shortcuts are often inconsistent across editors; ProseMirror tends to rely on widely-used shortcuts.

That said, as I mention here[0], I am most hopeful for Slack's text editor, which supports many more enhanced features -- but unfortunately doesn't seem open-source, and is currently quite buggy.

[0]: http://espadrine.tumblr.com/post/129926358821/web-editors

Re: Trix: A rich text editor for everyday writing

#123
post #100
post #90

Earlier quoted context omitted.

Is "what would be useful is an editor that supports design" an echo chamber? Mightbe pretty hard to do right, but not an ordinary idea. About rich text editors, since there are so many editors (even native) that lag on input I have just assumed that is something that only I care about.

Probably more the "You just have to learn a few HTML tags", which reminded me (since it was quoted in another discussion today) of the comment about Dropbox saying that it was trivial to replicate by getting FTP space, mounting it using some tool and running SVN on top. EDIT: https://news.ycombinator.com/item?id=10412530

[deleted]

Re: Trix: A rich text editor for everyday writing

#124
post #100
post #90

Earlier quoted context omitted.

Is "what would be useful is an editor that supports design" an echo chamber? Mightbe pretty hard to do right, but not an ordinary idea. About rich text editors, since there are so many editors (even native) that lag on input I have just assumed that is something that only I care about.

Probably more the "You just have to learn a few HTML tags", which reminded me (since it was quoted in another discussion today) of the comment about Dropbox saying that it was trivial to replicate by getting FTP space, mounting it using some tool and running SVN on top. EDIT: https://news.ycombinator.com/item?id=10412530

Sharing files between NAT:ed computers is extremely hard compared to understanding simple XML.

That said, it's kinda sad we need "specialists" to make web content. Maybe we should abandon HTML for a binary format for WWW 2.0 like with HTTP!?

Re: Trix: A rich text editor for everyday writing

#125

Earlier quoted context omitted.

Okay, time to write up an article about all these different WYSIWYG editors.

Please include wysihtml5 on your list :) http://xing.github.io/wysihtml5/

Would you like to collaborate on an article?

Re: Trix: A rich text editor for everyday writing

#126

Looks decent. The approach taken is the right one: we do something very similar with the Squire rich text editor ( https://github.com/neilj/Squire ) which I wrote for FastMail's webmail. Basically the browser can't be trusted to do any formatting itself, which is a slightly depressing state of affairs, especially as there has been zero improvements in this area for the last 5 years. I guess it's not shiny enough for…

Can you elaborate on not being able to trust the browser for formatting? Is the idea that web developers should just be able to use and not have to think about it beyond that, and that browsers should provide solid default editor?

I mean things as simple as bolding a piece of text. The way to get the browser to do this for you is to using the document.execCommand method, but the results are inconsistent between browsers. Worse than that though is stuff like hitting "enter" on the keyboard – all sorts of crazy stuff happens (new tags being added, nothing consistent between browsers, generally doesn't do what you want). We came to the same solution the guys at Basecamp have: you generally can't trust the browser to get you from state A -> B and have to do it yourself.

Probably the hardest thing to do is handle copying and pasting, partly because most browsers give you very little control over this, so you have to resort to terrible hacks. You also have to decide how much of the formatting in the clipboard item was "intentional" and how much should be cleaned. I see if you copy/paste just a word from within Trix, it pastes it as a whole block with the block's formatting around it. I suspect this may surprise many users who expect it just to copy the word (the inline bit, not the block around it in editor parlance). Once you start going down this rabbit hole, you end up having to do things like take one DOM tree and recursively merge the "edges" with the adjacent trees to get it to behave as the user expects. I think we do a pretty decent job with Squire, but I'm sure there are still more edge cases we haven't covered.

Re: Trix: A rich text editor for everyday writing

#127
post #62

Earlier quoted context omitted.

Going from the README, the main difference is the architecture. It creates a layer of indirection between user actions and the DOM. This has two advantages: * For developers of Trix itself, it eases the pain of cross-browser development - as the README says, contenteditable is inconsistent across browsers. * For developers using Trix, you get a clean API (Trix.editor) so you can edit the document programmatically wit…

'contenteditable is inconsistent across browsers'. We (the Guardian) created Scribe to tackle this: https://github.com/guardian/scribe (I can't take any credit personally though alas!)

I tried Scribe and was quite enthused about it but there are trivial bugs that never got fixed, been a year since I filed this issue[1]:

Basically, http://jsfiddle.net/L59kL1rf/ -- you cannot delete the first paragraph and always end up with

and if you try to delete that it just starts acting strange. This issue has been open since 2014 and it seems it's a bug in the core.

There were other similar issues I ran into around the same and decided I would revisit later but it's been a nearly a year since.

[1]: https://github.com/guardian/scribe/issues/300

Re: Trix: A rich text editor for everyday writing

#128

Great timing, we were just looking for a new editor for our project. Since there are so many choices, here's a list of everything mentioned in this post. Trix - https://github.com/basecamp/trix - demo here: http://trix-editor.org/ by basecamp and used in v3, handles files/images well Squire - https://github.com/neilj/Squire - used in FastMail webmail, better for text than images ProseMirror - http://prosemirror.net/…

What is the quality problem with Redactor 3?

v2 is their newest release: http://imperavi.com/redactor/log/

They've removed features like html code view (which is basic and needed since no editor is perfect), formatting for pasted-in text is worse (even from just another webpage), image handling is broken (cant resize or even move around anymore), and lots of stability bugs in general.

Re: Trix: A rich text editor for everyday writing

#129

Earlier quoted context omitted.

What is the quality problem with Redactor 3?

v2 is their newest release: http://imperavi.com/redactor/log/ They've removed features like html code view (which is basic and needed since no editor is perfect), formatting for pasted-in text is worse (even from just another webpage), image handling is broken (cant resize or even move around anymore), and lots of stability bugs in general.

Sorry I meant v2. I am using v1 but as I just use it for basic formatting I am not really keen on the high upgrade price. I do think they have done great work with the editor though. If the editor was important for my app then the price would be much less of an issue.

Pasting and image handling is probably the most important features for my clients. Thx for the info.

Post reply on HN