Re: [w3c/editing] Define behavior of pressing enter in inline editing host (Issue #430)

I discussed it within Chromium and we think that the algorithm can be simplified to insert a simple line break (`<br>`) if one of the following holds:

* There is no enclosing block of the selection position
* The enclosing block is one of these:
    * A [Phrasing Content](https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content) element
    * A table cell or table element
* An `<hr>` element

This is implemented in Chromium [here](https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc;drc=a742c65cc620d2b7b262b5514540ebdb510a7121;bpv=1;bpt=1;l=238?q=insert_paragraph_separator_command).

The part about phrasing content was added recently, and has not yet been successfully shipped to the stable channel. It's based on an [equivalent change](https://github.com/WebKit/WebKit/commit/37c9962af2e3af8339a71539efdcd40c813d6bd6#diff-62b93c3eda712d14d0be1084c4bd28bc49bf5e81af3b9ca07e552065324dc5f4) to WebKit.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/430#issuecomment-1648680941
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/430/1648680941@github.com>

Received on Monday, 24 July 2023 21:56:21 UTC