In a test file such as;
\documentclass{article}
\begin{document}
\begin{itemize}
\item Short line of text
\item Comparatively long line of text to illustrate that latex is wrapping my text to a preset margin when I have not highlighted it.
\end{itemize}
\end{document}
the text wraps with the preset margin definition. No problem.
However, if the text in either the bullet or subsequent sub-bullet lines are highlighted with \colorbox{colour}{text} then wrapping does not occur. I am using;
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[usenames, dvipsnames]{color}
to modify text colours and my custom margin definitions are made by;
\usepackage[margin=1in,includefoot,includehead]{geometry}
Here is an example of the highlighting I wish to perform.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[usenames, dvipsnames]{color}
\usepackage[margin=1in,includefoot,includehead]{geometry}
\begin{document}
\begin{itemize}
\item Short line of text
\item \colorbox{yellow}{Comparatively long line of text to illustrate that latex is not wrapping my text to a preset margin when it is being highlighted.}
\begin{itemize}
\item \colorbox{yellow}{The problem persists with sub-bullet points too. I assume this is an issue with the coloring command and not my margin definitions.}
\end{itemize}
\end{itemize}
\end{document}
This is what the issue looks like, if I have not explained myself appropriately;
Please note that if I continue writing in the same line after the highlighted section, the text will wrap as expected.

