The inline editing captabilities within the hubspot CMS rely on the hubspot rich text UI rendering in the same frame as the website content itself.
A good read on best practices to ensure your code works well inside the editor can be found here Accounts Dashboard | HubSpot