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

On Wed, Jan 11, 2012 at 12:38 PM, Ryosuke Niwa <> wrote:
> That sounds like a great idea.
> . . .
> 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>

Ojan suggested in the other thread that we instead allow calling
execCommand() on Element, and have the result restricted to that
Element.  That solves the global-flags problem too, and doesn't
require new attributes.  So you'd do

  div.execCommand("tabindent", false, "true");

or whatever.  Someone could still call
document.execCommand("tabindent", false, "false"), but that would be
overridden if it was called on the editing host.  I filed a bug on it:

Does that sound good too?

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

Default paragraph separators are used in a couple of other places too,
so it would be a little more work than that.  But I just looked, and
it wouldn't be as bad as I thought.  So this is doable if people have
any good use-cases.

Received on Wednesday, 11 January 2012 20:10:04 UTC