I think the whole URI should be encoded just to be safe so: "#{encodeURI("markdown-preview://#{path}")}"