Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22043

Hyperlinks on the "Details" - pane do not work any more

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None

      The 17309-fix damaged the working hyperlinks.
      (https://issues.jenkins-ci.org/browse/JENKINS-17309
      "Escape XML symbols in warning messages")

      As I mentioned here
      https://wiki.jenkins-ci.org/display/JENKINS/PcLint+options
      I put some hyperlinks on the "Details" - pane. After an update they
      do not work any more, the clear text is displayed, eg:

      (Info <a href="http://pc-etw-039:8080/userContent/LintMsgRef.html#750">750</a>)

      I first thougt of putting a feature request to make the escaping optional.
      But this seems overblown. Isn't there a simpler solution, eg "un-escaping" the xml?
      Or should I try to write my own parser?

          [JENKINS-22043] Hyperlinks on the "Details" - pane do not work any more

          Ralf Hain added a comment -

          Tried with double-escaping and CDATA, neither works.

          Write a new parser "PC-Lint-unescaped"?
          Feature Request: checkbox for deactivating the escaping?

          Ralf Hain added a comment - Tried with double-escaping and CDATA, neither works. Write a new parser "PC-Lint-unescaped"? Feature Request: checkbox for deactivating the escaping?

          Ulli Hafner added a comment -

          Wouldn't it be simpler to add improve the escaping: if it is valid XML then do nothing, otherwise escape the entities?

          Ulli Hafner added a comment - Wouldn't it be simpler to add improve the escaping: if it is valid XML then do nothing, otherwise escape the entities?

          Ralf Hain added a comment -

          Thanks for the reply.

          Both issues, the 17309 and 22043 are of the case "If it is not valid XML" -> do escaping. So I think that this would not help.

          Simple '<' and '>' seem to work before and after the update, just '<WordBetween>' are correct now on gcc-warnings but do not work with my hyperlinks.

          gcc-warnings: I parse them just occassionally, PC-Lint is more important for me. Perhaps I should sacrifice the gcc-parsing? Applying a local patch? ... must be inside the Analysis-Core between, 1.50 and 1.51 ... havent found it yet.

          By the way, the hyperlinks also do not work in the Source Code Visualization - tooltips, because tooltips by desing do not support hyperlinks.

          I have no new ideas how to really fix this.

          Ralf Hain added a comment - Thanks for the reply. Both issues, the 17309 and 22043 are of the case "If it is not valid XML" -> do escaping. So I think that this would not help. Simple '<' and '>' seem to work before and after the update, just '<WordBetween>' are correct now on gcc-warnings but do not work with my hyperlinks. gcc-warnings: I parse them just occassionally, PC-Lint is more important for me. Perhaps I should sacrifice the gcc-parsing? Applying a local patch? ... must be inside the Analysis-Core between, 1.50 and 1.51 ... havent found it yet. By the way, the hyperlinks also do not work in the Source Code Visualization - tooltips, because tooltips by desing do not support hyperlinks. I have no new ideas how to really fix this.

          Ulli Hafner added a comment -

          You are right, that won't help.

          I think changing the PC Lint parser would be the best thing: I think this parser should not escape XML entities at all (or are there some entities in the messages that need to be escaped?).

          In order to do this AbstractAnnotation in analysis-core needs an additional constructor (or factory method) that allows unescaped descriptions.

          Ulli Hafner added a comment - You are right, that won't help. I think changing the PC Lint parser would be the best thing: I think this parser should not escape XML entities at all (or are there some entities in the messages that need to be escaped?). In order to do this AbstractAnnotation in analysis-core needs an additional constructor (or factory method) that allows unescaped descriptions.

          Ralf Hain added a comment -

          Entities: Yes, there are character entities, eg the shift operator << . But they were displayed correctly even before the update.

          Before the update the PCLint-warnings.xml looks like:

           A zero has been given as right argument to operator &apos;&lt;&lt;&apos; 

          After the update:

            A zero has been given as right argument to operator &amp;apos;&amp;lt;&amp;lt;&amp;apos; 

          What I suspect: The Parser should indeed do the escaping but with the exception of a hyperlink, "<a href= ..."
          But maybe Your suggestion (no escaping at all) will also work.

          By the way: PC-Lint features a xml-output, correctly escaped.
          Seems like I have to take a deeper peek into the sources / test data.

          Ralf Hain added a comment - Entities: Yes, there are character entities, eg the shift operator << . But they were displayed correctly even before the update. Before the update the PCLint-warnings.xml looks like: A zero has been given as right argument to operator &apos;&lt;&lt;&apos; After the update: A zero has been given as right argument to operator &amp;apos;&amp;lt;&amp;lt;&amp;apos; What I suspect: The Parser should indeed do the escaping but with the exception of a hyperlink, "<a href= ..." But maybe Your suggestion (no escaping at all) will also work. By the way: PC-Lint features a xml-output, correctly escaped. Seems like I have to take a deeper peek into the sources / test data.

          Ralf Hain added a comment -

          Here is a workaround:
          removing all & escapes from PCLint-warnings.xml
          Characters '<' '>' '"' also occur in the message besides the hyperlinks, but apparently it does not harm to replace also them.

          With Post+build+task plugin, sed and windows batch it looks like:

           
          sed -i "s|[&]amp;|\&|g" %WORKSPACE:workspace=jobs%\builds\%BUILD_NUMBER%\PCLint-warnings.xml
          rem  (using braces with [&]: otherwise the Post+build+task plugin will not properly escape it.)
          

          (The Any+Build+Step+Plugin might work also)

          Ralf Hain added a comment - Here is a workaround: removing all & escapes from PCLint-warnings.xml Characters '<' '>' '"' also occur in the message besides the hyperlinks, but apparently it does not harm to replace also them. With Post+build+task plugin , sed and windows batch it looks like: sed -i "s|[&]amp;|\&|g" %WORKSPACE:workspace=jobs%\builds\%BUILD_NUMBER%\PCLint-warnings.xml rem (using braces with [&]: otherwise the Post+build+task plugin will not properly escape it.) (The Any+Build+Step+Plugin might work also)

          Ulli Hafner added a comment -

          Should be fixed with JENKINS-25511.

          Ulli Hafner added a comment - Should be fixed with JENKINS-25511 .

            drulli Ulli Hafner
            ralf_hain Ralf Hain
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: