45

I would like something like the Markdown options (of SO?), where

four leading spaces makes it look like code
blocks have been written
wescpy
  • 10,689
  • 3
  • 54
  • 53
sameers
  • 4,855
  • 3
  • 35
  • 44

2 Answers2

71

Google (Hangouts) Chat only supports basic (not rich nor full Markdown) formatting. For your specific inquiry, use pairs of triple backticks, i.e.,

```
Hello
World
```

For this and other formatting directives, see either the consumer help page (for end-users), or the simple messages page (for developers) in Google's documentation.

wescpy
  • 10,689
  • 3
  • 54
  • 53
  • 5
    And use `` to put the newlines in - took me a while to work that out. – Hamish Downer Apr 30 '20 at 13:19
  • However, that's only true if you're typing verbatim. Most people cut-n-paste their code, so it's not necessary to do that for this scenario. – wescpy Apr 30 '20 at 16:01
  • I paste my code in, but my code doesn't usually have the triple backticks around it - so I use `` to put the triple backticks around the code I'm pasting in. – Hamish Downer May 01 '20 at 20:17
  • That's only if you need the extra line(s). I think I just `````` and don't think about the extra NEWLINES. – wescpy May 01 '20 at 21:15
  • 7
    I figured that the code snippet __MUST__ be plaintext. So when you copy and paste your code, make sure to paste plaintext without formating. For mac: `Command` +`Shift`+`V` should do the job. – Arif Fikri Abas May 18 '22 at 06:44
14

If it's a single line, you can use it between single back quote.

`Hello World`
Yunus ER
  • 1,999
  • 2
  • 9
  • 14