URLs in {code:xml}

Issue #42 resolved
Former User created an issue

If i enter URLs in a XML-Snippet in a {code:xml}-Tag, it works fine in the preview, but in the result view it gets surrounded by <a>-Tags.

This makes our code snippets unusable.

Comments (26)

  1. Holger Schimanski repo owner

    Thank's for reporting! I guess I have to add auto-links: false parameter to prevent URLs to be clickable, because JIRA Syntax Highlighter Macro is setting RenderMode.allow(RenderMode.F_HTMLESCAPE); which means that characters get escaped. I will have a closer look.

    Cheers, Holger

  2. Holger Schimanski repo owner

    I have tried to reproduce your problem in JIRA 6.2.4, but don't see the problem there. Which version of JIRA are you using?

    Cheers, Holger

  3. Former User reporter

    Could you please add the same content with {noformat}-tag and without any tag? It looks this for us (attached file).

    I will do a sql-query to select what the db says.

    thank you for prompt help.

  4. Holger Schimanski repo owner

    It is simply

    {code:xml}
    <?xml version="1.0"?>
    
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3schools.com"
    xmlns="http://www.w3schools.com"
    elementFormDefault="qualified">
    
    </xs:schema> 
    {code}
    

    But if you use JIRA Syntax Highlighter the URLs are clickable, so a <a href=""> is inserted by the plugin. Somehow it looks like the < gets escaped and therefore is not shown as a proper link.

    Which version of JIRA Syntax Highlighter are you using? Did you recently updated from a previous version?

  5. Former User reporter

    We are using v1.8.0 and did not do any update the last 90 days. i think this behaviour did not recently appeared, but we didn't notice this yet.

    This is the sourcecode delivered on loading the issue:

    <div style='margin-left: 1em;'><pre class='brush: xml; toolbar: false;'>
    &lt;archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 
    http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" 
        xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="maven-cosa-business-webservice"&gt;
    </pre><img onload='SyntaxHighlighter.highlight();' style='display:none;' src='/s/de_DEhokmc1-1988229788/6158/17/1.8.0/_/download/resources/jira.plugin.syntaxhighlighter.macro.syntaxplugin:images/blank.png'/></div>
                </div>
    

    here seems indeed something to be escaped. is this normal?

  6. Holger Schimanski repo owner

    That HTML source code delivered on loading the issue looks perfect.

    Which browser and operating system are you using?

  7. Former User reporter

    We are using Windows 7. Thank you for this hint, i tested now with different browsers. Result:

    Firefox 24.5.0 ESR does not work Chrome 34.0 does not work IE 10 does work

  8. Former User reporter

    i'm afraid this does not completely solve the problem: the links are now not longer clickable, but there is still the <a-tag surrounding the http://example.de-text.

    so it would be ok for us, if the link was clickable, but it's not solved as long as the <a-tag appears still to us. Can you reproduce?

  9. Holger Schimanski repo owner

    In my company we use Firefox 24.3.0 ESR and IE 8 on Windows 7 with and JIRA 6.2 and 5.2 on Linux and don’t have these problems. Can you check with other colleagues if this is a problem with your local browser or your company installation of your browser?

  10. Former User reporter

    I tested on the browsers in this screenshot. i deactevated all plugins and add-ons. i will be able to test with a normal (not esr) firefox release in a few days. the delivered source code is everywhere the same, so i don't think it's a server-side problem (e.g. a jira version problem).

    are you able to test with one of the same versions as i tested?

    2014-05-28_09h31_27.jpg

  11. Former User reporter

    I'm afraid, i can not reproduce this in v3.0.83, too. 2014-06-17_12h10_38.jpg In our JIRA-Instance we are using Add-On v1.9.0 and there the problem still happens.

  12. Holger Schimanski repo owner

    Thanks for your feedback! I will prepare another test case with escaped content inside the <pre> tag.

  13. 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?

  14. Former User reporter

    Sorry for late answer - i am not able to beta-test a unstable product with major changes because we are currently running only a productive instance. but if this version is stable, i will install it and check if our problem persists or not.

  15. Holger Schimanski repo owner

    Version 2.0.0-beta1 is now available for download here, which fixes the problem described here.

    Please raise an issue here, if you find any other problems or bugs with this new major release.

    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

    P.S. No problem, that you are not able to test. I hope to get feedback from other user to be sure, everything works fine after this major change.

  16. Log in to comment