Instead of

    $dom = new DOMDocument();
    $dom->loadHTML($string);

I think the proper approach is to use Drupal's filter_dom_load() in order to properly convert ampersands, en dashes and such.

    $dom = filter_dom_load($string);

Without this change, I'm seeing weird characters in the filtered HTML.

Patch to follow.

Comments

othermachines created an issue. See original summary.

othermachines’s picture

Status: Active » Needs review
StatusFileSize
new642 bytes

Patch.

  • yookoala committed 4abd850 on 7.x-1.x
    Issue #2974802 by othermachines: Strange characters in filtered content...
yookoala’s picture

Assigned: Unassigned » yookoala
Status: Needs review » Fixed
yookoala’s picture

Status: Fixed » Closed (fixed)