In certain situations, I have text or html which begins and/or ends with a space. For instance:
$text = " and a previous sentence continues ";
$html " and a <i>previous</i> sentence continues ";
In using $docx->addText($text) the resulting docx include all spaces in the $text variable. Excellent.
In using $docx->embedHTML($html) then the first and last spaces (i.e. the " " before "and", the " " after "continues") are stripped.
I have tried to replace any first or last space with   but that does not seem to correspond to ordinary spaces in the resulting docx. The   is larger than and ordinary space and does not show as a "dot" when i display formatting marks in Word/libreoffice.