This link explains the whole story:
The fix is to add this web.config key. In the configuration/SharePoint/PageParserPaths configuration section add something like this:
WARNING: There is a reason why Sharepoint does this so only use it when you need it. It can be dangerous to give designers access to the file and accidentally have them edit your code.