rendeer problems with python code

Issue #23 resolved
Hector Palacios created an issue

Apparently rendeer of Python code has some problems with square brackets adding some extra lines. I tested the following piece of code:

#!/usr/bin/python
from generic import *
import salib
import Wrapper

if __name__ == "__main__":
    testclass = sys.argv[0].split('_')[-1].split('.')[0]
    input_parameters = salib.params_list(' '.join(sys.argv[1:]))
    handler = Wrapper.Wrapper(testclass, input_parameters)
    if handler.result:
        handler.run ()
        if not handler.result:
            print "\n[ERROR] %s has failed. Verify the output " \
                                            "in your terminal\n" % testclass
        handler.close()
    ret_code = 0 if (handler.result) else 1
    del handler
    sys.exit(ret_code)

and got the following result (see attached screenshot)

Comments (13)

  1. David Martin

    It's actually the integer literals causing the issue here. Attempting to render:

    test=42
    

    Will result in:

    test=
    42
    

    I haven't gotten a chance to look for the underlying issue yet in the source, so I can't offer any more guidance beyond that.

  2. Holger Schimanski repo owner

    This is a general problem of all integer values. They get css class "value" e.g. <code class="python value">=</code>, but value is also used in issuenav.css with display: block; which results in line breaks.

  3. Holger Schimanski repo owner

    Adding display: inline !important; to .syntaxhighlighter .value in shThemeDefault.css helps, but I am not sure, if this is enough and if this is a good solution.

    Should it also be added to all other .syntaxhighlighter like .syntaxhighlighter .variable, .syntaxhighlighter .functions?

    Or shall I trust in JIRA, that JIRA is not using any of the class names of SyntaxHighlighter and overwriting some style attributes?

    Or shall I put .syntaxhighlighter code{display: inline !important;} to shCore.css?

  4. David Martin

    I would go with ".syntaxhighlighter code" rule, as long as you don't ever need a <code> element that is not inlined. Not trusting JIRA's other css definitions is probably best.

  5. clausw

    I installed Version 1.6.2 with Jira 5.2.6 and it is still not resolved.

    2013-01-24 11:59:10,877 TP-Processor4 ERROR xyzv 719x81111x1 1qxaxn3 123.01.01.123 /secure/CreateIssue.jspa [webwork.util.ValueStack] METHOD: "createHtml", exception:
    java.lang.NullPointerException
            at ... (ServiceObjectCFType.java:91)
            at ... (ServiceObjectCFType.java:58)
            at ...(CustomFieldUtils.java:446)
    

    It creates a line break in my Jira after every number.

    (I even tried to reinstall)

  6. Holger Schimanski repo owner

    Can you please try reload the page resp. restart your browser? Might be a caching problem.

    The exception message belongs to a custom field, not to syntax highlighter plugin.

  7. Holger Schimanski repo owner

    Found out, that the created jar did not include the latest sources. Therefore I release a new version 1.6.3 on the Atlassian Marketplace. Please update to get bugfix for this issue.

    Kind regards Holger

  8. Log in to comment