# TeX4ht: conflict between hyperref and optional arguments of proof

MWE:

\documentclass{amsart}
\usepackage{hyperref}

\newtheorem{theorem}{Theorem}

\begin{document}
\begin{theorem}\label{thm}
This is a theorem.
\end{theorem}

\begin{proof}[Proof of Theorem~\ref{thm}]
This is a proof.
\end{proof}
\end{document}


Compiled with make4ht, one gets

[ERROR]   htlatex: ./test.tex   11   Extra \else.


There is no error if hyperref package is not included. It is also worth to mention that, this issue also appears if we replace \begin{proof}[Proof of Theorem~\ref{thm}] by \begin{proof}[Proof of Theorem~\hyperref[thm]{some theorem}].

I wonder the reason and a workaround. Thanks.

This issue was caused by removing of some supplemental code for Hyperref in TeX4ht. This was done because of clashes with BibLaTeX. As I found also other issues caused by this change, I've reintroduced the original code back to TeX4ht sources. In the meantime, you can use local copy of the hyperref-hooks.4ht file:

% hyperref-hooks.4ht (2021-12-08-12:41), generated from tex4ht-4ht.tex
% Copyright 2021 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2021-12-08-12:41}

% we don't have any code here for now
\:AtEndOfPackage{%