Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-10936

Using something that looks like a Jira issue key in a link label or shortcut renders wrong markup

    XMLWordPrintable

Details

    Description

      Summary

      Using something that looks like a Jira issue key in a link label or a link shortcut (i.e. [link label](http://example.com), [label][link shortcut]) will render the wrong markup.

      Link shortcuts

      In a markdown comment / document, let the string pattern in the shortcut reference link match the text in the body

      [Rendering][ASB-1-comment]
      
      ASB-5 and ASB-7
      
      [ASB-1-comment]: http://example.org/
      

      Expected result

      Rendering
      
      ASB-5 and ASB-7
      

      Actual result

      Note that any reference to ASB-7 is gone and there is now a link to ASB-1 and ASB-5.

      Rendering
      
      ASB-1 and ASB-5
      

      the markup markup

      <p><a href="http://example.org/" target="_blank">Rendering</a></p>
      <p>
          <a 
              class="markup-issues-trigger" 
              data-issue-keys="ASB-1" 
              data-initial-issue-key="ASB-1" 
              data-single-issue="true" 
              href="https://jira/browse/ASB-1" 
              target="_blank"
          >
              ASB-1
          </a> 
      
          and 
          <a 
              class="markup-issues-trigger" 
              data-issue-keys="ASB-5" 
              data-initial-issue-key="ASB-5" 
              data-single-issue="true" 
              href="https://jira/browse/ASB-5" 
              target="_blank"
          >
              ASB-5
          </a>
      </p>
      

      Link labels

      In a markdown comment / document, let the string pattern in the link label match a Jira issue

      [ASB-3][ASB-1-comment]
      
      [ASB-1-comment]: http://example.org/
      

      Expected result

      <p>
          <a href="http://example.org/" target="_blank">ASB-3</a>
      </p>
      

      Actual result

      <p>
          <a href="http://example.org/">
              <a 
                  class="markup-issues-trigger" 
                  data-issue-keys="ASB-3" 
                  data-initial-issue-key="ASB-3" 
                  data-single-issue="true" 
                  href="http://localhost:8080/browse/ASB-3"
              >
                  ASB-3
              </a>
          </a>
      </p>
      

      Workaround

      Use different string pattern in the body of the shortcut reference link.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              voseghale VICTOR-OSEGHALE
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Backbone Issue Sync