TeX4ht uses some tricks to support Unicode input. In XeLaTeX, it makes most of characters active. The active characters are then used to insert \special
commands with instructions for Unicode. It seems to clash with Polyglossia in this case, as you can see from the full error message:
! TeX capacity exceeded, sorry [main memory size=5000000].
\nobreakspace ...l {t4ht@+\string &{35}x00A0{59}}x
The problem is that Polyglossia with XeTeX makes some characters active as well. Somehow it results in memory overflow. In your case the problem is with colon in your title \title{Test: 123}
.
To fix that, we must redefine \nobreakspace
at the moment when Polyglossia defines active characters, which is done by the \french@punctuation
command.
Save the following code as gloss-french.4ht
:
\pend:def\french@punctuation{\bgroup\let\nobreakspace\space}
\append:def\french@punctuation{\egroup}
\endinput
This file is loaded automatically by TeX4ht when you use Polyglossia with French.
The \pend:def
command executes code before the redefined command, \append:def
executes it after command ends.
Your example then compiles without errors:
