Overwrite methods in Discourse.Utilities

Hi Simon, thanks for your reply. This is exactly what I want. But upon following your javascript code, I get error that Discourse.Utilities is undefined.
Uncaught TypeError: Cannot set property 'getUploadMarkdown' of undefined
and it stills calls the old getUploadMarkdown method.