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

Code highlighting with markdown in comments is broken

XMLWordPrintable

      Issue Summary

      When editing a comment with markdown code, the highlighting is working, but once the comment is saved, all highlighting is gone. See attached picture for reference.

      Steps to Reproduce

      1. Step 1: Add a comment in the pull request like the below:
        ``` C++
        auto powerEnable = isi->GetTisPowerEnable().lock();
        if (powerEnable) {
            *powerEnable = false;
            *powerEnable = true;
        }
        ```
        

        You see some of the word highlighted before you post the comment.

      2. Step 2
        When you click on the Comment button, you see that the syntax highlighting is gone.

        Expected Results

        The syntax highlighting should remain after the comment is posted

        Actual Results

        The syntax highlighting is gone after the comment is posted even though it shows up while drafting the comment

      Workaround

      Use a different alias for the code highlighting mode as defined in CodeMirror's codebase (look if the highlighting mode you need has an alias, if it does, use one of the listed aliases). For instance in the noted case above, a working highlighting mode is cpp.

        1. BB 7.7, 7.6, 7.5, 7.4.png
          BB 7.7, 7.6, 7.5, 7.4.png
          268 kB
        2. BB 7.3.png
          BB 7.3.png
          138 kB
        3. BB 6.10.png
          BB 6.10.png
          163 kB

              Unassigned Unassigned
              04f11a9d4cc8 Apoorva
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: