Pressbooks\Modules\Export\Mpdf\Pdf::fixAnnoyingCharacters PHP Method

fixAnnoyingCharacters() public method

This function prevents mPDF from completely aborting the export routine, or replacing each non-breaking space with a '?' if ignore_invalid_utf8 is true. Important to leave this in.
public fixAnnoyingCharacters ( string $html ) : string
$html string
return string
    function fixAnnoyingCharacters($html)
    {
        // Replace Non-breaking spaces with normal spaces
        $html = preg_replace('/\\xC2\\xA0/', ' ', $html);
        return $html;
    }