pc035860 / angular-highlightjs

AngularJS directive for syntax highlighting with highlight.js
http://pc035860.github.io/angular-highlightjs/example/
MIT License
294 stars 53 forks source link

use require.js was Error #79

Open ermu592275254 opened 7 years ago

ermu592275254 commented 7 years ago

when I use require.js management of my js code,load the angular-highlight.js is failed, The error message: "GET http://localhost:3000/js/hljs.js 404" but I did't create hljs.js file. and "require.js:166 Uncaught Error: Script error for: hljs"

I load highlight.js and angular.js is succeed, console.log('hljs') can see something about it.

how i need set angular-highlight.js??

pc035860 commented 7 years ago

Hi @ermu592275254

Sorry for the late response.

highlight.js originally have their AMD module defined as hljs. They've changed it to anonymous at https://github.com/isagalaev/highlight.js/commit/b4ea6460c91ca410bded7e4bdab346f4382c55b3.

You'll have to defined it yourself in order to use it with current angular-highlightjs.

See https://github.com/isagalaev/highlight.js/issues/1288#issuecomment-243972595

caemasar commented 6 years ago

Use highlight.js --> $('pre code').each(function(i, block) { hljs.highlightBlock(block); });