In @tuleap/prose-mirror-editor
, there is a plugin "AutomagicLinks" whose role is to detect whenever the user typed a url (+ a space char) and wrap it in a link mark.
However, the strategy it uses does not work, because whatever text that do not make the URL constructor throw an error is considered to be a valid url:
In the example above, the URL constructor did not throw any error because the text contained a colon (:) character, so the plugin transformed it into a hyperlink.
Let's instead use a custom InputRule with a proper regexp.