6

I am trying to reply to a comment, on a PR, on bitbucket with a code snippet instead of plain text, from the associated slack channel.

Sanvir
  • 93
  • 1
  • 1
  • 6

3 Answers3

6

It is quite straightforward. Put the code lines in between these(```). As StackOverflow is following the same thing, I have to apply some trick:

Let ``` = AAA. Then,

AAA

This is your code. Place your code here.

AAA

This will be the output:

This is your code. Place your code here.
Aadil Hoda
  • 592
  • 7
  • 17
5

use 3 '`' chars to make a code block. you can also give a language syntax hint by adding the name of the language after the 3 ticks.

i.e.

```javascript
var x = 0;
```

which looks like

var x = 0;

or you can do inline code using a single '`'.

i.e.

Your variable `VAR_NAME` is never initialized

which looks like this

Your variable VAR_NAME is never initialized

Dan
  • 2,625
  • 7
  • 39
  • 52
1

Have a look at the Atlassian markdown syntax guide:

https://confluence.atlassian.com/bitbucketserver/markdown-syntax-guide-776639995.html

In to format your comment as a code block you indent it by 4 spaces.

eeijlar
  • 1,232
  • 3
  • 20
  • 53