From e9894be38f76d67f7c8b8e5d16f16e8b14b96f40 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Thu, 4 Nov 2021 03:01:01 +0000
Subject: CTAN sync 202111040301

---
 macros/latex/contrib/reledmac/reledmac.dtx | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

(limited to 'macros/latex/contrib/reledmac/reledmac.dtx')

diff --git a/macros/latex/contrib/reledmac/reledmac.dtx b/macros/latex/contrib/reledmac/reledmac.dtx
index 996dc98008..9009f1a2ae 100644
--- a/macros/latex/contrib/reledmac/reledmac.dtx
+++ b/macros/latex/contrib/reledmac/reledmac.dtx
@@ -587,6 +587,8 @@
 % \changes{v2.38.0}{2021/05/30}{Add \protect\cs{Xnopagenumberifcurrent} hook.}
 % \changes{v2.38.0}{2021/05/30}{Add \protect\cs{Xbeforepagenumber} hook.}
 % \changes{v2.38.1}{2021/09/27}{Fix incompatibility between \protect\parpackage's option \protect\option{continuousnumberingwithcolumns} and lineation by page.}
+% \changes{v2.38.2}{2021/11/03}{Fix bug when using \protect\cs{applabel} in conjunction with \protect\package{hyperref} package.}
+% \changes{v2.38.2}{2021/11/03}{Fix some trouble in indentation in stanza, when switching to some language with \protect\package{polyglossia}.}
 %      Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
 % has version number \fileversion, last revised \filedate.}}
 %
@@ -4476,7 +4478,7 @@
 %    \begin{macrocode}
 %<*code>
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2021/09/27 v2.38.1 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2021/11/03 v2.38.2 typesetting critical editions]%
 %    \end{macrocode}
 %
 % \subsection{Package options}
@@ -8318,6 +8320,18 @@
         \showlemma{#1}%
         }%
 %    \end{macrocode}
+% If using \package{hyperref} package, we put the final hypertarget for \cs{applabel}.
+%    \begin{macrocode}
+            \ifdef{\hypertarget}%
+              {%
+                \def\do##1{\Hy@raisedlink{\hypertarget{##1:end}{}}}%
+                \ifcsdef{applabel@thisedtext@\the\@edtext@level}{%
+                  \dolistcsloop{applabel@thisedtext@\the\@edtext@level}%
+                  \global\cslet{applabel@thisedtext@\the\@edtext@level}{\empty}%
+                }{}%
+              }%
+              {}%
+%    \end{macrocode}
 %
 % Finally, we add any insertions that are
 % associated with the \emph{end} of
@@ -9039,7 +9053,9 @@
   \global\setbox\raw@text=\vbox\bgroup%
     \if@nobreak%
       \if@afterindent\else%
-        \noindent%
+        \unless\ifinstanza%
+          \noindent%
+        \fi%
         \global\@afterindenttrue%
       \fi%
     \fi%
@@ -16951,6 +16967,15 @@
 %    \begin{macrocode}
       \@esphack%
 %    \end{macrocode}
+% If using \package{hyperref}, store the label in a list for the current edtext, to call later an hypertarget for the end of the lemma.
+%    \begin{macrocode}
+            \ifdef{\hypertarget}%
+            {%
+              \ifcsundef{applabel@thisedtext@\the\@edtext@level}{\global\cslet{applabel@thisedtext@\the\@edtext@level}{\relax}}{}%
+              \listcsgadd{applabel@thisedtext@\the\@edtext@level}{#1}%
+            }%
+            {}%
+%    \end{macrocode}
 % Warning if \protect\cs{applabel} is called outside of \protect\cs{edtext}.
 %    \begin{macrocode}
   \else%
-- 
cgit v1.2.3

