HTMLpurifier was casuing this problem.
I had to update HTMLPurifier Lite to Version 4 and then I added
$config->set('Attr', 'EnableID', true); $config->set('Attr', 'EnableAttrID', true); to the constructor in HTMLPurifier.php Anchors work perfectly and the formating of my page is retained! R.