Typing a valid URL and pressing Space creates a clickable link with that
URL. Users expect the same to happen when pressing Enter instead (with
or without holding Shift), but that was not the case previously.
This commit enables link creation with both Enter and Shift+Enter. It
factorises the code that creates the link into a function
`_handleAutomaticLinkInsertion`.
While this feature is part of the `keydown` event for Space and
Shift+Enter, it is part of the later `input` event for Enter (without
Shift). This is due to a required call to historyRollback(), which would
undo the just-created link, forcing its creation to be delayed.
Two tests have been added for these new use cases. For the Space use
case, an existing test has been adapted to account for the change of
handling (from `input` to `keydown` event). That test is also simplified
to avoid modifying the DOM content (which was meant to replicate the
exact behavior of the browser for regular users, deemed not necessary
for tests).
Task-3094666
closesodoo/odoo#122001
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>