mercredi 15 avril 2015

HighlightJS not working with block call

I'm trying to get Highlight.JS working and am running into the following error when I call the hljs.highlightBlock() call:



TypeError: Cannot read property 'replace' of undefined



This error comes from the highlight.pack.js file and because its minimized it was hard to tell where exactly but I beautified it and it the error seems to be coming from this line (line 7 in the beautified script):



function n(e) {
return e.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;")
}


Here's a little more context showing my current DOM environment. First off you can see that I have identified a code block in the DOM (myDom) and also that the hljs object is available:


state diagram


But then, just to demonstrate from the browser's CLI it failing:


state diagram2


I'm including the Ember community in this too just in case it has something to do with the recent "ember-disable-prototype-extensions" module now being included in addons for Ember-CLI.


Aucun commentaire:

Enregistrer un commentaire