The groff manual indexes "\|" which is output in the LaTeX output as
\index[es]{\textbackslash{}"|@\texttt{\textbackslash{}"|}}% However this leads to an error: ! Extra }, or forgotten \endgroup. <recently read> } l.72 \item \texttt{\textbackslash{}|}} , 186 ? es.idx has a line \indexentry{\textbackslash{}"|hyperindexformat{\@\texttt{\textbackslash{}"|}}}{1 which becomes in es.ind \item \texttt{\textbackslash{}|}}, 186 " is supposed to escape the first | but this doesn't work properly. The only thing I could find is this page from 2014: https://tex.stackexchange.com/questions/176931/how-to-escape-character-in-index but this only treats | in the math context. A commenter there says it "confuses hyperref". The "hyperindexformat" texts appears to be something added by hyperref. Does anybody know (or know where we could ask) how to escape a | character in an index entry correctly?