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

Un-encoded parenthesis in file paths causes inappropriate Jira Issue links

    XMLWordPrintable

Details

    Description

      Issue Summary

      When a file is referenced or attached that contains a set of characters matching a Jira issue, and a set of parenthesis is contained anywhere within the file's path or name other than the 'Jira issue' portion, the hyperlink's rendering breaks.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Open up a pull request or anywhere you can submit a comment.
      2. Submit a comment with the following raw text:
        • [test](this-is-a-test-TEST-123.sql) `[test](this-is-a-test-TEST-123.sql)`
          [test2](this-is-a-test-(TEST)-123.sql) `[test2](this-is-a-test-(TEST)-123.sql)` 
          [test3](#this-(is)-a-test-TEST-123.sql) `[test3](#this-(is)-a-test-TEST-123.sql)`
          [test4](#this/is/a-path-to-a-file/this-is-a-test-TEST-123.sql) `[test4](#this/is/a-path-to-a-file/this-is-a-test-TEST-123.sql)`
          [test5](#this/is/an-(important)-path-to-a-file/this-is-a-test-TEST-123.sql) `[test5](#this/is/an-(important)-path-to-a-file/this-is-a-test-TEST-123.sql)`
          [test6](#this/is/an-(important)-path-to-a-file/this-is-a-test.sql) `[test6](#this/is/an-(important)-path-to-a-file/this-is-a-test.sql)`
          

      Expected Results

      All of the hyperlinks are rendered correctly, and the Jira issue IDs in the code blocks next to each hyperlink are unclickable.

      Actual Results

      The hyperlinks for test3 and test5 are broken, and there is a clickable Jira issue link within the test's associated code block.

      Workaround

      Omit the offending set of parenthesis, or manually encode them when creating the path/filename in the link. (So "(" --> "%28", and ")" --> "%29")

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eslaughter@atlassian.com Evan Slaughter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: