I have a long underlined glossary term that extends into the margin. Ulem package not helping. This is an example
\documentclass[12pt]{memoir}
\usepackage{ulem}
\usepackage[hidelinks]{hyperref}
\hypersetup{
linktocpage=true,
colorlinks=false,
linkcolor={false},
unicode=true,
pageanchor=true
}
\usepackage[toc,nogroupskip]{glossaries}
\makeglossaries
\renewenvironment{theglossary}% needed in additon to nogorupskip option
{\begin{list}{}
{%
\setlength\labelwidth{0pt}%
\setlength\itemindent{-\leftmargin}%
\setlength\itemsep{0pt}%
\setlength\parsep{0pt}%
\let\makelabel\descriptionlabel}%
}
{\end{list}}
\renewcommand*{\glstextformat}{\emph}
\newglossaryentry{primary and secondary formations}{
name= primary and secondary formations,
description={A unity fo two formations.}
}
\begin{document}
In the case of history we speak of the theory as a theory of
\gls{primary and secondary formations}. This term points to the unity
of two formations if indeed those formations actually exist.
\printglossaries
\end{document}