Fix for removing spaces from element captions (should only sanitize element handles).