Live data from Hacker News

Trix: A rich text editor for everyday writing

github.com

131–137 of 137 posts

Re: Trix: A rich text editor for everyday writing

#132
post #19

Earlier quoted context omitted.

This doesn't support images as far as I can tell

Trix fully supports file attachments and image attachments, as documented in the readme. It includes an inline caption editor for images. Trix also supports "content attachments" (currently undocumented) which allow embedding arbitrary HTML as attachments in the document. Basecamp 3 uses this feature to embed @mentions with avatars, and various oEmbed types, in messages and comments.

I want to see those "content attachments" as a live demo!

I'm currently using CKEDITOR in a Rails app and inserting HTML "templates." CKEDITOR renders the HTML and allows the end-user (or content creator) to modify the HTML while it is rendered inside the contenteditable text area.

Re: Trix: A rich text editor for everyday writing

#134

One thing this gets right that heaps of other WYSIWYG's get wrong is lists. You can create a proper multi-level list here with order and unordered lists nested inside each other correctly. This sort of stuff is actually important for creating accessible documents as things like flowcharts need a plain text version and nesting lists is a reasonable way of displaying these.

My litmus test for WYSIWYG lists — which Trix fails — is

  1. start a numbered list

  2. put several paragraphs...

     > including some nested block element e.g. quote

     ... inside one list item

  3. Then continue the numbered list (not from 1!)
This is something that's trivial to express in markdown, LaTeX etc but annoying to impossible with WYSIWYG where being in a list pretends to be a per-paragraph boolean property. In many WYSIWYGs you can't semantically put block-level stuff "into" a list item, only fake it by pressing Enter, cancelling numbering on the new paragraph and increasing indent to align with list item.

This makes it a nightmare to continue the list afterwards, because actually I've already closed it. Surprisingly, while many WYSIWYG editors are only ready to start a new "1. " list, they do allow me to paste the compound item into the middle of an existing list without interrupting its numbering. Sometimes there are other rituals involving liberal consumption of Shift+Enter and Backspace, dancing with text, and promising my firstborn to be contentEditable...

Anyway Trix fails it on the simpler task of multiple paragraphs in a list item. I haven't looked at the code but it seems its content model (at least strictly enforced) for list items is something like:

- a single block element (can be a quote or code) - followed by zero or more sublist items.

It's good that Trix won't let me increase indent on a paragraph that doesn't fit its content model. But I need a stronger model for my docs...

Now a quote does allow multiple block content! What happens when I put a quote inside a list and then add sub-lists inside the quote? Madness:

  1. foo
  2. | bar
     | baz (this was Enter, not Shift+Enter)
  3. | 1. sublist
  4. | 1. | ququux
     |    | multi-line/paragraph.
  5. | 1. #code () {####
     |    ###...########
     | 1. #}############
  6. | WAT?
  7. | * ulist...
  8. | * | 1. | - he he
I'd hope the continuous outer / non-continuous inner numbering is just styling bugs and not a crazy model?

P.S. A smaller usability issue: how do you make a numbered list with bullet sublist (or vice versa)? Enter->increase indent->switch to bullets works but Enter->switch to bullets leaves me with no option to increase indent. Unnecessarily confusing.

Anyway, lists are why I hate all WYSIWYG with passion as a user. I wish WYSIWYM with explicitly visible structure (cf. TeXmacs) was more popular.

Re: Trix: A rich text editor for everyday writing

#135
post #134

One thing this gets right that heaps of other WYSIWYG's get wrong is lists. You can create a proper multi-level list here with order and unordered lists nested inside each other correctly. This sort of stuff is actually important for creating accessible documents as things like flowcharts need a plain text version and nesting lists is a reasonable way of displaying these.

My litmus test for WYSIWYG lists — which Trix fails — is 1. start a numbered list 2. put several paragraphs... > including some nested block element e.g. quote ... inside one list item 3. Then continue the numbered list (not from 1!) This is something that's trivial to express in markdown, LaTeX etc but annoying to impossible with WYSIWYG where being in a list pretends to be a per-paragraph boolean property. In many…

Reported the clear bugs (#63, #64). not sure if the list content model is bug or intentional, though allowing the first line of an item to be a single quote or code block + the freedom inside a quote does make it questionable IMHO... (cf. http://spec.commonmark.org/0.21/#principle-of-uniformity)

P.S. Squire doesn't seem to allow block content inside lists. Only Shift+Enter linebreaks.

ProseMirror does allow block content (it defaults to markdown content model); continuing the numbered list after non-sublist items required the paste-into-existing-list dance.

Firepad does allow non-item content but doesn't align it like part of the list. It does tend to continue the numbering afterwards, not sure what are its exact rules.

None of this is IMHO satisfactory UX. I've observed many people struggle with lists in any WYSIWYG I've ever seen :-(

Re: Trix: A rich text editor for everyday writing

#136

This a good time to ask about a good, open source text editor that outputs to Markdown instead of HTML?

http://hallojs.org/demo/markdown/ http://sofish.github.io/pen/ https://github.com/bevacqua/woofmark http://prosemirror.net/demo_markdown.html

Haven't seriously used any of those but I'd put my money on ProseMirror as the most principled one.

Re: Trix: A rich text editor for everyday writing

#137

Earlier quoted context omitted.

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

Would you like to collaborate on an article?

Sorry, I only just saw this message. I'd defintely offer to contribute if you're writing one alhough I'm not hugely familiar with many (but am with wysihtml5, quill and CKEditor).
Post reply on HN