Recurse to both sides, fix capture groups, replace HTML entities.