Tom and Csaba, to ensure working hyperlinks in your exported PDFs, you should always convert your URLs to complete hyperlinks in InDesign. PDF readers will do their best to detect valid URLs, but they can't be relied upon to do this consistently, particularly when URLs have line breaks (as you have discovered) or they are incomplete/naked URLs (missing the http:// or https://).
If you have many URLs, you certainly don't want to be doing this manually, one at a time. InDesign comes with a script pre-installed to do automatic URL conversions for you, called 'Convert URLs to Hyperlinks', which you can read about in the InDesign User Guide here: https://helpx.adobe.com/au/indesign/using/hyperlinks.html#convert_urls_to_hyperlinks
If the built-in script doesn't meet your needs, I developed a more reliable and extensive script called Hyperlinker, which you can download here: https://inkwire.app/hyperlinker/download/ (There's a free version for documents up to 3 pages, and a paid version for larger documents.)
Tom and Csaba, to ensure working hyperlinks in your exported PDFs, you should always convert your URLs to complete hyperlinks in InDesign. PDF readers will do their best to detect valid URLs, but they can't be relied upon to do this consistently, particularly when URLs have line breaks (as you have discovered) or they are incomplete/naked URLs (missing the http:// or https://).
If you have many URLs, you certainly don't want to be doing this manually, one at a time. InDesign comes with a script pre-installed to do automatic URL conversions for you, called 'Convert URLs to Hyperlinks', which you can read about in the InDesign User Guide here: https://helpx.adobe.com/au/indesign/using/hyperlinks.html#convert_urls_to_hyperlinks
If the built-in script doesn't meet your needs, I developed a more reliable and extensive script called Hyperlinker, which you can download here: https://inkwire.app/hyperlinker/download/ (There's a free version for documents up to 3 pages, and a paid version for larger documents.)