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, "&").replace(/</gm, "<").replace(/>/gm, ">")
}
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:
But then, just to demonstrate from the browser's CLI it failing:
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