# Line breaks in non-clickable URls inside itemize-environment?

I want to list som URLs within an itemize-environment. I would like to break long URLs into several lines, either anywhere in the link, or at locations I specify.

I've tried using the breaklinks option for the hyperref package, and I've tried manually specifying locations where line breaks would be accepable. However, the former only seems to break links around punctuation, and the latter inserts TeX commands in the final PDF (see below). Example code:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{itemize}
\end{itemize}
\lipsum[2]
\begin{itemize}
\end{itemize}
\end{document}


The issues with this are shown below. Does anyone know a way to achieve what I want, or a clever workaround?

• Add \usepackage{xurl} to your preamble. Jul 12, 2020 at 18:28

The xurl package allows urls to be broken between any character. Adding it to the preamble results in the following output:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{xurl}