Syntaxhighter javascript should only be included in the context of issues

Issue #47 resolved
Andy Brook [Plugin People] created an issue

Hi there, JEMH also uses the underlying syntax highlighter javascript library as part of the JEMH Regexpal in-place regexp tester. Accessing that screen with this add-on installed breaks, due to a conflict.

I've known about this conflict for a while, but having just had it brought up again, I thought I'd log an issue. Are you able to exclude administration screens from this addons javascript inclusion? Is there are reason for it being included on all pages?

Its also quite possible JEMH can somehow initialize the syntax highlighter in a noconflict way, this isn't something I've explored yet.

Comments (9)

  1. Holger Schimanski repo owner

    The context of the JavaScript web resources is currently set to <context>atl.general</context> in atlassian-plugin.xml. That might be changed to be more specific.

  2. Andy Brook [Plugin People] reporter

    Hi Holger, Thanks for getting back to me, its a little odd, Im seeing:

    Uncaught TypeError: undefined is not a function regexpal.js:138
    (anonymous function) regexpal.js:138
    (anonymous function)
    

    I have a feeling the syntax highglighter lib needs to get loaded directly as a web resource, jemh does this through a jemh specific custom context, so its only loaded on JEMH pages. I think your case is different, as you're annotating issue content, is it just limited to issues or 'everywhere'?

  3. Holger Schimanski repo owner

    I am currently working on a major change switching from JavaScript/client side to Java/server side syntax highlighting. This will fix #42, #48 (problems with certain browser versions), #44 (syntax highlighting in activity streams) and #45 (syntax highlighting in emails), #46 and #47 (interference with other plugins like Links Hierarchy and JEMH using regex JS lib).

    Would you be able to test a beta release of this plugin?

  4. Holger Schimanski repo owner

    Version 2.0.0-beta1 is now available for download here.

    It contains implementation for

    • syntax highlighting in emails
    • syntax highlighting in activity streams
    • has support for collapse parameter
    • switches to line numbers not being shown by default
    • layout is now similar to Confluence

    Sample with all features of JIRA Syntax Highlighter Plugin incl. line numbers, first line, highlight and title. (Only collapse is not shown here).

    {code:java|linenumbers|firstline=5|highlight=7,8-9|title=Example for HelloWorld.java}
    // Hello World in Java
    class HelloWorld {
      static public void main( String args[] ) {
        System.out.println( "Hello World!" );
      }
    }
    {code}
    

    This will be rendered as shown in the following screenshot. example-layout.png

    Please raise an issue here, if you find any problems or bugs.

    Currently brushes for Objectiv-C, TCL, Gherkin and D are missing, but will be delivered as part of 2.0.0-beta2 resp. the final release.

    Best regards, Holger

  5. Log in to comment