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

Gitea organization descriptions fail to render HTML

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • gitea-plugin

      In Gitea Organizational Folders, HTML is not stripped from project description and does not make use of Safe Render HTML in Jenkins.  However, the Gitea Description allows for HTML, so when the plugin automatically imports the description it will turn the HTML into plain text, thus cluttering the page with unparsed HTML.  No related settings have been found to strip/render HTML so I consider this a bug because the Gitea plugin is not properly handling the Gitea project description and automatically imports to the Jenkins page.

          [JENKINS-73226] Gitea organization descriptions fail to render HTML

          Gwenael added a comment -

          Hi,

          I can work on it, but I don't know the procedure, if any, to assign this issue to myself and push it in the backlog.

          Gwenael added a comment - Hi, I can work on it, but I don't know the procedure, if any, to assign this issue to myself and push it in the backlog.

          Adam Outler added a comment -

          As the reporter, apparently I have the ability to assign.  

          Adam Outler added a comment - As the reporter, apparently I have the ability to assign.  

          Gwenael added a comment -

          Thank you I will do my best!

          Gwenael added a comment - Thank you I will do my best!

          Gwenael added a comment - - edited

          Issue reproduced with:

          • OS Kubuntu 24.04
          • Jenkins v2.479.2
            • Gitea plugin v220.v4618c82a_40fb_
            • Folders plugin v6.963.v6edc0fc71472
            • Owasp markup formatter plugin v162.v0e6ec0fcfcf6
          • Gitea v1.22.4
          • local environment (One PC, localhost)

          Here is a screenshot from my setup with the reproduced issue where a repository named dummy-test is created on Gitea, and where the description contains HTML tags (safeHTML is activated in Jenkins).

          Gwenael added a comment - - edited Issue reproduced with: OS Kubuntu 24.04 Jenkins v2.479.2 Gitea plugin v220.v4618c82a_40fb_ Folders plugin v6.963.v6edc0fc71472 Owasp markup formatter plugin v162.v0e6ec0fcfcf6 Gitea v1.22.4 local environment (One PC, localhost) Here is a screenshot from my setup with the reproduced issue where a repository named dummy-test is created on Gitea, and where the description contains HTML tags (safeHTML is activated in Jenkins).

          Gwenael added a comment -

          I found the source of the issue. It seems to come from the Branch API plugin:

          <j:choose>
           <j:when test="${p != null and p.objectUrl != null}">
            <a href="${p.objectUrl}"><j:out value="${col.formattedDescription(p,job)}"/></a>
           </j:when>
           <j:otherwise>
            <j:out value="${col.formattedDescription(p, job)}"/>
           </j:otherwise>
          </j:choose> 

          The call of col.formattedDescription(p, job) formats the received description. For the test purpose, changing by p.objectDescription displays the text formatted as HTML normally. I will propose a fix containing a Markup formatter call (HTML safe), but I think it is needed to clone this issue to Branch API plugin too.

          Here is a screenshot of the result when setting p.objectDescription instead:

           

          Gwenael added a comment - I found the source of the issue. It seems to come from the Branch API plugin: <j:choose> <j:when test= "${p != null and p.objectUrl != null}" >   <a href= "${p.objectUrl}" > <j:out value= "${col.formattedDescription(p,job)}" /> </a>   </j:when>   <j:otherwise>   <j:out value= "${col.formattedDescription(p, job)}" />   </j:otherwise> </j:choose> The call of col.formattedDescription(p, job)   formats the received description. For the test purpose, changing by p.objectDescription displays the text formatted as HTML normally. I will propose a fix containing a Markup formatter call (HTML safe), but I think it is needed to clone this issue to Branch API plugin too. Here is a screenshot of the result when setting p.objectDescription  instead:  

          Gwenael added a comment -

          An issue was reported in Branch API plugin which is the root cause of the issue.

          Gwenael added a comment - An issue was reported in Branch API plugin which is the root cause of the issue.

            gwenaelg Gwenael
            adamoutler Adam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: