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

Use the latest version of CommonMark for markdown rendering

XMLWordPrintable

    • 8
    • 1
    • 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.

      In Bitbucket 5.16.2 - 6.2.3 (only versions tested) the following markdown is not rendered properly:

      <!-- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=6 orderedList=false} -->
      
      `features/steps/steps.py`
      ```python
      from testplan_bdd.step_registry import Given, When, Then
      
      @Given('we have two number: {a} and {b}')
      def step_definition(env, result, context, a, b):
          context.numbers = (int(a), int(b))
      
      
      @When('we sum the numbers')
      def step_definition(env, result, context):
          context.result = sum(context.numbers)
      
      @Then('the result is: {expected}')
      def step_definition(env, result, context, expected):
          result.equal(int(expected))(context.result)
      ```
      

      The decorators in this python code excerpt are shifted down. @Given is changed to @import, @When becomes @Given & @Then becomes @When. Only the decorators are changed however, the rest of the line remains the same.

      If you remove the line <!-- @import "[TOC]" {\cmd="toc" depthFrom=2 depthTo=6 orderedList=false} --> then the decorators all display correctly.

      When you take this same excerpt to https://spec.commonmark.org/dingus/ it is rendered correctly

      The <!-- @import "[TOC]" {\cmd="toc" depthFrom=2 depthTo=6 orderedList=false} --> line is added by generated by the Visual Studio Code extension: Markdown Preview Enhanced

              Unassigned Unassigned
              cdrummond Craig Drummond
              Votes:
              11 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: