Including markdown support in CKEditor

Hi folks,

i've trying to include support for markdown in the CKEditor using this plugin: http://ckeditor.com/addon/markdown

I tryed several approachs, using CKEditor Extended plugin and also creating a different plugin with a customized version of CKEditor with markdown plugin bundled with it. I always get stuck in the same point, retrieving the same errors. It seems that the plugin, in Elgg context, cant load some JS libraries included in the the plugin. I got these errors in the dev console:

plugin.js?t=F0RD:2 Uncaught ReferenceError: toMarkdown is not defined
plugin.js?t=F0RD:7 Uncaught ReferenceError: CodeMirror is not defined

I think the problem is related with Elgg's JS library loading. I ran out of ideas how to continue.

Could any of you, more experimented developer, give this idea a try and help me to make it work?

 

Thx in advance!