`this` context is wrong when using MarkdownDeep.js parser
kspearrin opened this issue · 0 comments
kspearrin commented
I don't think that this is an EpicEditor issue directly, but I am looking for a possible workaround.
I am trying to use EpicEditor with MarkdownDeep.js (I am using MarkdownDeep on the server-side so I need the parsers to match) as the parser like so:
var markdown = new MarkdownDeep.Markdown();
var editorOptions = {
parser: markdown.Transform
}
var editor = new EpicEditor(editorOptions).load();
When EpicEditor invokes the markdown.Transform
function, this
inside the markdown.Transform
function is the context of the EpicEditor, not MarkdownDeep.Markdown
resulting in the following error on line 145 of MarkdownDeep.js:
Uncaught TypeError: this.ProcessBlocks is not a function
See the following JSFiddle for an example: https://jsfiddle.net/1saet37v/
Is there something I can do to fix this easily?