Re: Pressing Enter in contenteditable: <p> or <br> or <div>?

On Wed, Jan 11, 2012 at 7:39 AM, Aryeh Gregor <ayg@aryeh.name> wrote:
>
> Okay, so what API should we use?  I'd really prefer this be
> per-editing host.  In which case, how about we make it a content
> attribute on the editing host?


That sounds like a great idea.


> It can be a DOMSettableTokenList. Maybe something like
>
>  <div editoptions="tab-indent">
>
> where the attribute is a whitespace-separated list of tokens.  To
> start with, we can maybe have tab-indent (hitting Tab indents) and
> div-separator (hitting Enter produces div).  Does this sound like a
> good approach?  If so, what should we call the attribute?  And should
> it imply contenteditable=true, or should the author have to specify
> that separately?
>

I'm not sure if we should add just "editoptions" though given we might need
to add more elaborative options in the future. It might make more sense to
add a new attribute per option as in:

<div contentEditable paragraphSeparator="p" tabIndentation>

Also: are there any good use-cases for <br>?  Allowing <div> instead
> of <p> adds basically no extra complexity, but allowing <br> would
> make things significantly more complicated.
>

Should enter behave like shift+enter when br is the default
paragraph separator?

- Ryosuke

Received on Thursday, 12 January 2012 00:48:29 UTC