Escape simple quote for template compile