How to format a reply as a code snippet when responding to a bitbucket comment via slack?
Asked Answered
C

3

7

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.

Cinderellacindi answered 13/5, 2019 at 15:2 Comment(1)
I don't think this question is correct on StackoverflowInhaler
I
7

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.
Intensify answered 22/2, 2021 at 11:34 Comment(0)
N
9

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

Nicaragua answered 10/8, 2021 at 3:36 Comment(0)
I
7

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.
Intensify answered 22/2, 2021 at 11:34 Comment(0)
H
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.

Hypertension answered 14/5, 2019 at 0:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.