Can I force a line break ONLY in PDF export

I have a number of very long URLs in my bibliography. In the PDF export, some of the lines look terrible with huge white space due to the limitations on where line breaks occur (after / or . but not after -) within the URL text.

Upon looking at the PDF output, I can go back and insert a manual line break anywhere in the URL to make the PDF output look balanced. But that line break also renders in the web output, and due to the variable column width of the web output, it regularly creates an unnecessary line break in the middle of a URL.

I’d like to be able to put code in a location in the middle of the URL text that will force a line break that is only applied to the PDF export, and not the web output.

I know there are section and page break options exclusive to PDF export, but those functions don’t work for this situation which occurs within a paragraph.

I thought that the HTML for a zero-width space (& # 8203 ; ) might solve this problem, but Pressbooks strips this code.

Is there another solution that could achieve the desired result?

Thanks!