I'm using Emacs 29.2 on macOS.
GNU Emacs 29.2 (build 2, aarch64-apple-darwin23.3.0, NS appkit-2487.40 Version 14.3 (Build 23D56))
of 2024-01-26
This problem is most noticeable when using markdown-mode and goto-address-mode,
but it also seems to occur even if goto-address-mode is disabled in text-mode or fundamental-mode.
You can see the problem by evaluating the Lisp code below.
;;; foo.el
Evaluate the expression directly in the buffer or save it to a file and check it with the command below.
$ emacs --batch -l foo.el -f ert-run-tests-batch-and-exit