How do I turn on markdown mode in Telegram? [closed]
Asked Answered
B

12

51

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?

Blankenship answered 9/6, 2018 at 1:51 Comment(0)
M
38

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```
Mornay answered 7/12, 2021 at 16:55 Comment(4)
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). – Cruzcruzado
You are right, and also in Windows you can use Ctrl + K shortcut to create a link. – Mornay
--underline--, [hyperlink] and [user mention] does not work in latest version of telegram. – Fisken
@Fisken 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. – Mornay
H
35

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!

Huesman answered 25/9, 2018 at 19:44 Comment(2)
This does not work in Telegram desktop client (5.5.1) for OS X – Plaice
This does not answer the question. How did it get 25 upvotes? – Echeverria
F
17

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/)
Foray answered 9/6, 2018 at 6:9 Comment(5)
wow it works!! but how can I use it without showing "via Sean_Bot" this stuff? – Blankenship
because I see other guy running his own channel like me but he doing this without "via" stuff – Blankenship
You can use your bot with Android API invoker – Foray
hi Sean I don't know how to use android API invoker as you said. I'm very newbie and not a programmer. can you guide me please? – Blankenship
Does that mean you're sending message content to the bot? – Bergstrom
P
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.

Plaice answered 9/8, 2019 at 10:44 Comment(1)
bold, italic and hyperlinks works. Most of other markdown features such as headings, lists etc. does not work. – Delldella
B
6

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

Betaine answered 5/1, 2020 at 12:12 Comment(0)
A
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

Afraid answered 25/12, 2019 at 18:39 Comment(0)
B
3

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!

Bertle answered 13/6, 2022 at 7:46 Comment(0)
S
2

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

Subtilize answered 3/9, 2019 at 18:22 Comment(0)
C
2

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 .

Crowning answered 4/8, 2020 at 16:0 Comment(0)
P
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
Phillida answered 1/11, 2019 at 15:55 Comment(0)
S
-2
bot('sendmessage', [
chat_id => $chat_id,
text => 'this is sample text',
parse_mode => 'markdown' //or html
]);
Succotash answered 13/6, 2018 at 18:0 Comment(6)
what's this?I put all of these inside telegram directly? – Blankenship
this is sample code for don't have library telegram server – Succotash
so where should I put those code? server? where? I only have telegram on my desktop – Blankenship
Obviously this doesn't help since the question author asks about inserting a hyperlink using the official Telegram client. – Griffy
"Code only" answers are often confusing/cryptic. Try adding a short introduction to the snippet to explain, where it should run, etc. – Icecap
love this answer. exactly what I was looking for :) – Library
S
-3

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

Succinic answered 15/4, 2020 at 1:48 Comment(6)
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. – Katherine
@Katherine Could you send the buggy testcase? – Succinic
(All written in separate lines which might not be shown in SO comments) TEST CASE 1 : -------> # Header1 ## Header2 ### Header3 (expected behaviour: "<h1>Header1</h1>" etc... found behaviour: "# Header1" etc.) TEST CASE 2: -------> - item1 - item2 - item3 (expected behaviour: "<ul><li>item1</li></ul>" etc.... found behaviour: "- item 1" etc.) – Katherine
Getting <hr> by putting "---" also does not work... – Katherine
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 "<strong>text</strong>" result, but the more outdated/naive "<b>text</b>"... – Katherine
As of January 2022 this bot seems to only be replying in Italian...? – Englebert

© 2022 - 2024 β€” McMap. All rights reserved.