[tex4ht-commits] [SCM] tex4ht updated: r1164 - trunk/lit
Michal Hoftich
INVALID.NOREPLY at gnu.org.ua
Fri Jul 1 16:16:10 CEST 2022
Author: michal_h21
Date: 2022-07-01 14:16:09 +0000 (Fri, 01 Jul 2022)
New Revision: 1164
Modified:
trunk/lit/ChangeLog
trunk/lit/tex4ht-4ht.tex
Log:
Fixed handling of undefined referenced in the \hyperref command
Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog 2022-06-30 15:37:22 UTC (rev 1163)
+++ trunk/lit/ChangeLog 2022-07-01 14:16:09 UTC (rev 1164)
@@ -1,3 +1,9 @@
+2022-07-01 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-4ht.tex (hyperref.4ht): fixed handling of undefined
+ references in the \hyperref command.
+ https://tex.stackexchange.com/a/649552/2891
+
2022-06-30 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-mathml.tex (mathml.4ht): retain text formatting inside
Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex 2022-06-30 15:37:22 UTC (rev 1163)
+++ trunk/lit/tex4ht-4ht.tex 2022-07-01 14:16:09 UTC (rev 1164)
@@ -5321,10 +5321,7 @@
% \Configure{ref}{}{}{}\ref{#1}}}
\<config hyperref\><<<
-\def\label at hyperref[#1]#2{{%
- \def\hyperrefLabel{#2}%
- \Configure{ref}
- {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
+|<label@@hyperref|>
|<autoref references|>
|<restore pre hyperref|>
|<nameref.sty NOT HERE|>
@@ -5331,6 +5328,35 @@
\csname ReadBookmarks\endcsname
>>>
+% We don't use this code anymore
+% \def\label at hyperref[#1]#2{{%
+% \def\hyperrefLabel{#2}%
+% \Configure{ref}
+% {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
+
+The \Verb+\hyperref[label]{title}+ command should print the
+title when label is undefined. The older configuration printed
+?? instead. This should fix this issue.
+\Link{https://tex.stackexchange.com/a/649552/2891}{}More info\EndLink.
+
+\<label@@hyperref\><<<
+\def\label@@hyperref#1#2#3{%
+ \ifx#1\relax
+ \protect\G at refundefinedtrue
+ \@latex at warning{%
+ Hyper reference `#2' on page \thepage \space undefined%
+ }%
+ \begingroup
+ \hyperrefundefinedlink{#3}%
+ \endgroup
+ \else%
+ \def\hyperrefLabel{#3}%
+ \Configure{ref}%
+ {\Link}{\EndLink}{\Configure{ref}{}{}{}#3}\ref{#2}%
+ \fi
+}
+>>>
+
A \Verb+\def\@@hyperref#1#2#3{\Link[#2]{}{}#1\EndLink}+
got removed since it fails the second case below.
More information about the tex4ht-commits
mailing list.