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

Coverage plugin source file view strips out html tags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • coverage-plugin
    • Jenkins 2.479.3
      coverage 2.7.1

      If a source file has HTML tags (like a tsx file) they end up getting stripped out of the source file view.

      Observe how the div and button tags are missing above.

      Sample file:

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      import React from "react";
      
      export const App: React.FC = () => (
        <div>
          <button onClick={() => { console.log("Button One clicked") }}>Button One</button>
        </div>
      );
      
      <?xml version="1.0" ?>
      <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
      <coverage lines-valid="10" lines-covered="5" line-rate="0.5" branches-valid="3" branches-covered="2" branch-rate="0.6666" timestamp="1754066507007" complexity="0" version="0.1">
        <sources>
          <source>C:/git/mrichar2_tools/v8-coverage</source>
        </sources>
        <packages>
          <package name="main" line-rate="0.5" branch-rate="0.6666">
            <classes>
              <class name="App.tsx" filename="src\App.tsx" line-rate="1" branch-rate="1">
                <methods>
                  <method name="App" hits="1" signature="()V">
                    <lines>
                      <line number="3" hits="1"/>
                    </lines>
                  </method>
                  <method name="onClick" hits="1" signature="()V">
                    <lines>
                      <line number="5" hits="1"/>
                    </lines>
                  </method>
                </methods>
                <lines>
                  <line number="1" hits="1" branch="false"/>
                  <line number="3" hits="1" branch="true" condition-coverage="100% (1/1)"/>
                  <line number="4" hits="1" branch="false"/>
                  <line number="5" hits="1" branch="true" condition-coverage="100% (1/1)"/>
                  <line number="6" hits="1" branch="false"/>
                </lines>
              </class>
              <class name="index.tsx" filename="src\index.tsx" line-rate="0" branch-rate="0">
                <methods>
                  <method name="(empty-report)" hits="0" signature="()V">
                    <lines>
                      <line number="1" hits="0"/>
                    </lines>
                  </method>
                </methods>
                <lines>
                  <line number="1" hits="0" branch="true" condition-coverage="0% (0/1)"/>
                  <line number="2" hits="0" branch="false"/>
                  <line number="3" hits="0" branch="false"/>
                  <line number="5" hits="0" branch="false"/>
                  <line number="6" hits="0" branch="false"/>
                </lines>
              </class>
            </classes>
          </package>
        </packages>
      </coverage>
      

            Unassigned Unassigned
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: