Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-4434

Extending markdown with configurable links

    XMLWordPrintable

    Details

    • UIS:
      2
    • Feedback Policy:
      We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Description

      It would be very useful, to extend the markdown rendering with a regex search and replace. So, as a Stash Administrator I could configure the markdown engine to search and replace certain text strings with external links or custom HTML. Doing so would allow me to create links to external tools simply by finding certain text patterns in my Pull request descriptions, commit comments, etc.

      Ultimately, I'm more less concerned about the rendered markdown of file contents and more concerned about the rendering of meta-data (Pull request descriptions, comments , commits, etc). However having it apply to both would be useful.

      Please see "Section commentlink" - https://gerrit-documentation.storage.googleapis.com/Documentation/2.8.1/config-gerrit.html for a sample implementation of this concept. The configuration of such looks like the following:

      [commentlink "bugzilla"]
        match = "(bug\\s+#?)(\\d+)"
        link = http://bugs.example.com/show_bug.cgi?id=$2
      
      [commentlink "tracker"]
        match = ([Bb]ug:\\s+)(\\d+)
        html = $1<a href=\"http://trak.example.com/$2\">$2</a>
      
      

      basically it would look for the text 'bug #1234' and convert that to a link like: 'http://bugs.example.com/show_bug.cgi?id=1234'

      This is a feature common to most code browsing, and code review systems. And if included in Stash, would help set it far above any other competing product.

        Attachments

        1. commit-list-with-issues.png
          commit-list-with-issues.png
          5 kB
        2. commit-sidebar.png
          commit-sidebar.png
          4 kB
        3. pull-request-commit-list.png
          pull-request-commit-list.png
          6 kB
        4. pull-request-sidebar.png
          pull-request-sidebar.png
          3 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jgartrel James Gartrell
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated: