Microsoft teams: Code block syntax

Anonymous
2020-03-20T03:44:30+00:00

Hello all,

I am trying to decide if teams is right for my company and the last thing I need to make a decision is how to use code blocks inline.  I have found where I can change the formatting, but what I am looking for is how to do that with just keyboard input.

When you click to the change the text format it is beautifully color coded.  Is it possible to do that with the ``` chat command?

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2020-03-23T08:15:48+00:00

    Hi Will,

    Thanks for your classification. Now, I totally understand your concern.

    However, Teams does not support this feature yet. I understand it would be more convenient for you if we can just type some character in the chat window like “```c” and Teams would know you are going to use the C language and format the texts correctly. In this situation, I would suggest you submit your feedback to our Microsoft Teams UserVoice via this link or directly click the Help icon in the Teams client and select Suggest a feature. Your feedback is the best way to make our product perfect for you and others. Thanks for your understanding.

    By the way, you may already know we can use Code snippets as a workaround. We can specify the language in it.

    Thanks,

    Ray

    4 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-03-20T04:55:05+00:00

    Hi Will,

    Thanks for posting in our community.

    Yes, we can use Inline block of code in Microsoft Teams.

    For example:

    Multi-line code block ```[code block]
    Inline block of code [code text]

    For more information, you can refer to the following article:

    Use Markdown formatting in Teams

    Thanks,

    Ray

    0 comments No comments
  2. Anonymous
    2020-03-20T15:13:08+00:00

    How do I specify what language it is with the ''' command?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-03-23T01:43:18+00:00

    Hi Will,

    Thanks for your follow up.

    After you type ``` in the Teams chat window, the window will be changed from:

    to:

    And then you can specify any language you want.

    If you have any other questions, please let me know.

    Thanks,

    Ray

    0 comments No comments
  4. Anonymous
    2020-03-23T07:02:17+00:00

    I know how to bring up a code block with ```, but how do I specify a language from the command line?  We use python and c++.  Could you give a quick example of how I could specify those languages from the command line?

    1 person found this answer helpful.
    0 comments No comments