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

Conflict with Olark due to language attribute #36

Closed andrewboni closed 8 years ago

andrewboni commented 9 years ago

Hi, we use Olark on our site in order to chat with users. Seems that Olark injects the following code:

<script language="javascript" id="...

Angular highlightjs is also looking for this language= directive, which causes a conflict:

 Exception  Error: [$compile:ctreq] http://errors.angularjs.org/1.2.27/$compile/ctreq?p0=hljs&p1=language
Controller 'hljs', required by directive 'language', can't be found!

Any thoughts on how to properly resolve this? Thanks!

pc035860 commented 9 years ago

Hi @stormbytes

The issue can be easily resolved through setting the hljs controller requirement to be optional in those directives. But I'm also considering prefixing directive names with hljs-.

Do you think I should rename all related directive/attribute names or just directive names?

directive names

attribute names

pc035860 commented 9 years ago

Hey @andrewboni , v0.3.3 should work without errors now.

andrewboni commented 9 years ago

Great- taking a look now.

andrewboni commented 9 years ago

@pc035860 seems to be working- thanks for the fast resolution! Will let you know if I encounter anything else.

andrewboni commented 9 years ago

+1 agreed

On Mon, Jan 12, 2015 at 4:16 PM, Daniel Balfour notifications@github.com wrote:

Def a better idea to prefix attr-names

— Reply to this email directly or view it on GitHub https://github.com/pc035860/angular-highlightjs/issues/36#issuecomment-69673330 .