43

I created my own telegram channel and send broadcasts to my people. I saw that other people make clean hyperlinks in their message without showing the full URL.

I found that the syntax for this is [text](http://example.com), but it never works for me.

I know that I need to write this in markdown mode, but how do I turn on markdown mode when I send a message?

Michael T
  • 370
  • 4
  • 16
user9916658
  • 549
  • 1
  • 4
  • 5

12 Answers12

41

Today I found that in the Telegram desktop client I can add a hyperlink pressing Ctrl-K (or through popup menu by RightClick)! It's great! No bots and markdown needed!

aralex
  • 592
  • 4
  • 6
29

You can simply use markdown rules in telegram without the help of any third-party bots and just while typing messages.

Here is the "Telegram Markdown Syntax":

*bold \*text*
_italic \*text_
__underline__
~strikethrough~
||spoiler||
*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
![](tg://emoji?id=5368324170671202286)
`inline fixed-width code`
```block fixed-width code```
```python
pre-formatted fixed-width code block written in the Python programming language```
Matin Amani
  • 480
  • 4
  • 12
  • All but the hyperlink and user mention in your example work in _Telegram for macOS_ and _Telegram_ for iOS. For creating a link there's a context menu item and shortcut (⌘U on macOS). – Feuermurmel Mar 06 '22 at 11:00
  • 1
    You are right, and also in Windows you can use `Ctrl` + `K` shortcut to create a link. – Matin Amani Mar 07 '22 at 09:07
  • 4
    --underline--, [hyperlink] and [user mention] does not work in latest version of telegram. – dmitry_bond Jul 31 '22 at 09:26
  • 1
    @dmitry_bond about the underline syntax: Markdown doesn't have a defined syntax to underline text. I guess this is because underlined text is hard to read, and that it's usually used for hyperlinks. – Matin Amani Aug 01 '22 at 12:12
16

You can use Markdown or HTML style in parse_mode.

If you are using Telegram client, it didn't support, but you can use inline bot. For instance, copy following line to input area, and wait for result:

@Sean_Bot md [hello](https://t.me/)
Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
Sean Wei
  • 7,433
  • 1
  • 19
  • 39
9

At the official Telegram page there is @bold bot, which actually does what you need.

NOTE! There is an unpleasant limitation: It was not able to process more 256 characters.

Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
Vadym
  • 1,067
  • 1
  • 13
  • 24
  • 1
    bold, italic and hyperlinks works. Most of other markdown features such as headings, lists etc. does not work. – eNca Aug 20 '21 at 14:05
7

For MacOS you can use ⌘+U. Or select text and click right mouse button in order to see all possible actions.

asvetly
  • 1,739
  • 16
  • 17
5

I can send links on my Android phone as described below.

NOTE: This does not answer the question about enabling markdown which is actually not required.

Using your example, by typing text, selecting the word, and, from the menu that appears, selecting the more options menu:

enter image description here

And then the obvious Create Link:

enter image description here

ostergaard
  • 3,377
  • 2
  • 30
  • 40
2

On iOS you can use an markdown editor (e.g. iA Writer) switch to preview mode and copy/paste the result to Telegram.

2

2022 ANSWER

There are ways to simulate markdown in Telegram natively. You can still use some markdowns syntax as for ** bold ** but not for ![ images ] ( # ).

You can:

  • In Desktop (Windows and Mac): I didn't try it in Linux but I guess it works the same. Select and right click on the text you want to format and then select "transfrom".

  • Iphone and Android: Hold the finger in on the text you want to format to select it and you will find the formatting options there int the context menu.

  • Xiaomi and other non supported "context menu" devices: You can still get it working! Just hold the finger on the text you want to format and then tap the three dots at the top right corner of your screen. Remember that the text you want to format must be selected!

TauchMe
  • 87
  • 6
1

I was able to do this by copying RTF (rich text) from apps like Apple's TextEdit or Byword and pasting it into the desktop client's message area. You can also copy from other apps (like a browser), paste into an RTF word processor like TextEdit, and then paste into Telegram.

Results may vary if you're using a different setup, which isn't specified in the question, so I'll post any relevant details to my working environment here:

  • macOS 10.14.5 (Mojave)
  • Telegram: 5.6.1 (179691) AppStore
Dan
  • 11
  • 1
1

In Xiaomi phones you don't have option for edit text font or create hyperlink (unlike iphone) .
So Telegram X can solve your problem because it supports markdown .
Just type markdown link and send message :

[text](http://example.com)

Check this similar question .

mo1ein
  • 535
  • 4
  • 18
-2
bot('sendmessage', [
chat_id => $chat_id,
text => 'this is sample text',
parse_mode => 'markdown' //or html
]);
-2

Use Markdown to HTML Bot and copy the message under "Anteprima messaggio"

Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
  • I really wouldn't recommend that bot. Apart from it being in Italian, which might be a problem if you're not from Europe, it is also extremely limited in its functionality. Not even headings are recognized. – Rautermann Aug 03 '21 at 15:55
  • @Rautermann Could you send the buggy testcase? – Smart Manoj Aug 29 '21 at 03:48
  • (All written in separate lines which might not be shown in SO comments) TEST CASE 1 : -------> # Header1 ## Header2 ### Header3 (expected behaviour: "

    Header1

    " etc... found behaviour: "# Header1" etc.) TEST CASE 2: -------> - item1 - item2 - item3 (expected behaviour: "
    • item1
    " etc.... found behaviour: "- item 1" etc.)
    – Rautermann Aug 29 '21 at 07:25
  • Getting
    by putting "---" also does not work...
    – Rautermann Aug 29 '21 at 07:26
  • I'm not trying to be mean, but I don't even agree with the implementations of the stuff that does work... eg. "**text**" doesn't return the expected "text" result, but the more outdated/naive "text"... – Rautermann Aug 29 '21 at 07:34
  • As of January 2022 this bot seems to only be replying in Italian...? – Johannes Jan 22 '22 at 02:22