Tdesktop: Support formatting text (e.g. bold, italic, and link)

Created on 15 Dec 2014  ·  96Comments  ·  Source: telegramdesktop/tdesktop

Most helpful comment

Speaking of 'proper way', there is actually _still_ a chance for Telegram to be the first to do that!

The _proper markup_ should be:

**bold** //italic// __underline__ ~~strikethrough~~

Imho, this makes more sense than the current markup string for a couple reasons:

  1. Using an underscore to represent _italic_ is illogical and unintuitive.
    Moreover, it takes the dedicated character away from underlining words.
  2. _Two special characters_ at the beginning and the end will prevent all kind of conflicts (like the one described above) from happening, and double-character is just as fast and easy to type, as single.

So there you go Telegram, still a chance to beat WhatsApp and be the first ;-)

All 96 comments

Related #250.

That is not planned, because it will complicate everything. Telegram is mobile-first app, no such features can be widely used on mobiles.

@telegramdesktop This feature is not suitable for mobiles as It is for desktop client, but It is better You implement it on desktop client for the first time just like Skype.

@telegramdesktop Yeh. Like _hashtag search_ (c93e4e2)? Mobile versions doesn't support this feature.

It's impossible even if you use G+ way to do it?
I mean if you want to _BOLD_ _italic_ or -skitetrouth- you just add *, _ or - to the beginning and on the end of sentence.

This is going to be supported in Android and OSX, at least that's what the Bot API updated right now:
https://core.telegram.org/bots/api#sendmessage
Check the parse_mode field.

I think it's already implemented in Telegram Desktop :yum:

@auchri Sorry, but it isn't 😭

@telegramdesktop Are you planning on implementing this at any point, I feel this would be a good addition and it was stated on the bot API that it would be implemented into other clients "soon" back on september 7th.

@zackpollard It is supported in dev version already.

@telegramdesktop Yea, sorry, noticed the dev branch and found the dev builds after I made this post, running the dev build now and updated my bot API to support the formatting :P

Today they added @bold bot that is absolutely non-intuitive and can't make a part of message italic or bold.
code already works, why not add _italic_ and bold - the way we all are used to?

code already works, why not add _italic_ and _bold_ - the way we all are used to?

Agree, that would be pretty slick. Has anyone figured out if code supports multi-line messages or not? They don't seem to work on desktop at least.

@cubrr

``````

asdas
dasd

``````

gets

image

:wink:

@auchri Oh damn. That's nice. Thanks!

someone know if its possible to format italic this string "max_92" ? I'm having problem on escaping the _ inside the string

@KilluaFein It is possible to escape the _ easily by doing _ if sending the message with markdown formatting enable via a bot.

@zackpollard I've tried that, but returning http error 400: bad request

@zackpollard ops, done! correct syntax is _max___92

Now than Whatsapp support italic and _bold_, any chance for Telegram??

For a long time ago... Telegram has added inline-bots
@bold *bold* _italic_ [link](example.com)

For a long time ago... Telegram has added inline-bots

I knew it, but it is dirty with via @bold

@PeterMX just use @markdownrobot

But why? Why do we have to use 'third party' to be able to just mark a
substring in a message to be shown to others as bold or italic?
I don't know markdown syntax, for example.

@bold bot is no good because makes the whole message bold.
18 марта 2016 г. 11:16 пользователь "MeDeVILe" [email protected]
написал:

@PeterMX https://github.com/PeterMX just use @markdownrobot


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/telegramdesktop/tdesktop/issues/330#issuecomment-198269918

@baziliolg @bold can have custom markdown, try sending *bold* and _italic_ :)

@john-preston Why do we have support for monospace out of the box, but for bold and _italic_ we have to use @bold bot?

@sigod, API issue. API allows only code blocks in messages. Only Bot API allows to send bold and _italic_

To all the people saying: "just use @bold" → but what if I want to keep my messages _private?_

Besides of that, it's a really "dirty" way indeed (well said @PeterMX ! )

TBH, I was actually expecting Telegram to implement a proper way to do this before WhatsApp...

And to have this feature in telegram we have to wait for API update :(

Speaking of 'proper way', there is actually _still_ a chance for Telegram to be the first to do that!

The _proper markup_ should be:

**bold** //italic// __underline__ ~~strikethrough~~

Imho, this makes more sense than the current markup string for a couple reasons:

  1. Using an underscore to represent _italic_ is illogical and unintuitive.
    Moreover, it takes the dedicated character away from underlining words.
  2. _Two special characters_ at the beginning and the end will prevent all kind of conflicts (like the one described above) from happening, and double-character is just as fast and easy to type, as single.

So there you go Telegram, still a chance to beat WhatsApp and be the first ;-)

So there you go Telegram, still a chance to beat WhatsApp and be the first ;-)

and no, Whatsapp supported text formatting before telegram!

@pureby It's markdown, and it's widespread

I was really surprised when Telegram offered @bold. It's a really unclean solution imho...
I just noticed that @TwitterForwarderBot uses bold text supposedly without @bold...
Maybe there is a way now that has not been published yet.

@TwitterForwarderBot is bot. Bots can use all of Telegram markdown.

I was really surprised when Telegram offered @bold. It's a really unclean solution imho...

I agree. It's very dirty solution.

@sigod @FreshMarv Then ask server dev to allow it. Even if client sends formatted message, bold and italic is erased. So it's nothing TDesktop can do, you should use "Ask a question" or ping telegram on twitter.

Hi. I am try create telegrambot that coud send preformated messages to user. in web telegram text formated, but mobile erase all tags pre. May be you start maintain tag br in all your clients. Now mobile text not reading.

@stek29 It is "markup" in the context I used. "Markdown" is one unjustly widespread markup language. And I have just explained why it is inferior to the markup language proposed by me.

@pureby And this language is used for @bold.

@stek29 And in a lot of other places, like WhatsApp and YouTube; like I've said, it is _unjustly_ widespread. But how is that relevant to this particular discussion?

Should adding caption text for hyperlinks be a separate ticket?
I mean, the ability to embed a hyperlink where what is shown is some caption text, not the url that it points to.

may be buttons?

@matanser @bold [foo](http://example.com) gives foo

how to write strikeout/crossout text?

On iOS you're able to select a bit of text, select the 'B _I_ U' button and then you can bold or _italic_ it without any bot 🤔

@nO-OnE-910 yeah, formatting is finally allowed on server side.

Sidenote: *bold* and _italic_ isn't actually markdown.

On Telegram web *bold* is now coming out as bold and this is incorrect.

@GordonsBeard @Swissnetizen it's "Telegram markdown".

Yes, we need this without bots, and not implicit like in webogram! Only with buttons (like in ios?). And 1 more question - how to deal with @bold message length limit?

Now I know it's possible without bots. Plus messenger imply this in its' last update.

@MeDeVILe Where was this? I checked Telegram Desktop and there's no mention of this.

Really, it should be support of DOUBLE special characters to markdown.
Just try to use any word with underscore symbol and italic markdown together...

Does anyone know how I can use asterisks without making the text bold? I use asterisks a lot in my daily conversation and its bothering me to no end.

@MultiverseWolf what? Currently telegramdesktop support text formatting only thru bots, what do you mean?

@kirsan31 It works for me. If I put asterisks between text it becomes bold.

Actually I tried this right now, and I found working those:
bold text
_italic text_
fixed-width text
On the android app

@MultiverseWolf @96Octavian
We are talking here about telegramdesktop isn't it?

Sorry I was not clear at all, I can send them from the app and I see them formatted on the desktop, but viceversa still doesn't work I wonder why

How can i post bold text in desktop app? asterisk printed without bolding text now.

@96Octavian please don't confuse people.

Neither TDesktop nor official Android (till 3.15, 3.16 and up allow it) apps allow you to format a message without bots (except code/pre)

@itJunky only with bots. Try @bold for example.

In upcoming android version:

  • Ability to make text bold, italic or monospaced without the use of bots.

Any chance for TDesktop????

Latest android client supports double star bold and double underscore italic. Recent versions supported single star / single underscore, but they've changed it to keep everyone happy as there were complaints from people wanting to star-wrap words.

I'd like to see same in tdesktop (ie. double-star, double-italic). Tdesktop can already show such formatting from messages composed on android.

What about strikethrough text?

Now both Ios and Android version support formatting without bots and thru user interface!
Exotic android versions (like MIUI), that have own selection menu, doesn't support this with interface, but at least we can use ** and __
Tdesktop where it most needed, and where it can (and must!) be most user friendly, doesn't have this functionality!!!
May be we need create a new issue for this?
..................................UPD..............................
I've opened new issue #2847

and quotes

@roytam1 API issue. Feel free to contact Telegram Support.

That is not planned, because it will complicate everything. Telegram is mobile-first app, no such features can be widely used on mobiles.

Using markdown to add bold and italic is intuitive for any developer today. It is now ridiculous in telegram: many of my messages are full of underscores, and we all understand what they mean. Except Telegram 😄

@roytam1 API issue. Feel free to contact Telegram Support.

actually tried to contact Telegram Support but no response from them.

Wondering about talks of "markdown support in API" )
It is purely client task - just get plain text and just apply markdown formatting.

any news?

@vsvasya Some time ago Servers rejected parsed formatting from clients if they we're not bots.

@pureby

And I have just explained why it is inferior to the markup language proposed by me.

Wow, that's serious. Finally a markup language that makes sense, not like that John Gruber's nonsense we're forced to use every day. How is it going with the implementation? Can we see the code? Are you using C or Perl? Or maybe Rust or Go? Is it already documented? How did you call this brilliant soon-to-be worldwide standard that will finally replace markdown?

woah, i cannot believe we still cannot use bold _italic_

this issue was opened 3 years ago. This is totally nonsense

@mrzool If you're so worried about implementation, I suggest you open Telegram on your mobile phone and just try for yourself ;-) No need to make a fool of yourself in public.
You can thank me later.

@stek29 The point people, including @vsvasya, are trying to make (but looks like you intentionally keep missing), is that _the server doesn't have to be involved at all._ It is enough to simply instruct _the client_ to interpret certain combination of raw symbols as formatted text.

So please stop trolling, both of you.

_the server is not involved at all._ It is enough to simply instruct _the client_ to interpret certain combination of raw symbols as formatted text.

The server _is_ involved, because _he_ instructs the clients how they should format the messages.

@auchri In case you missed it, I replied to the claim of a certain individual above that _"formatting on desktop is impossible, because server rejects formatting"_. Smell the fallacy?

So people came up with an effective and easy _solution_ that does not involve tweaking server settings and has many other upsides (simplicity, effectiveness, transparency, flexibility, compatibility). So unless there is some hidden downside to the proposed _solution,_ I don't see what's wrong with letting the server "rest" and instructing _the client_ to do the formatting.

I was hoping that my previous comment would make that (finally) clear, but since some people prefer to focus on words so much they forget about the meaning, I have slightly rephrased my sentence to prevent further deviation from topic. Which is making text formatting _possible_.

@pureby Which "solution" are you talking about?

@auchri

the server doesn't have to be involved at all. It is enough to simply instruct the client to interpret certain combination of raw symbols as formatted text.

@pureby "Server settings" were tweaked almost half a year ago.
Also, it's not an "effective and easy solution", since it requires app to interpret both server side formatting and local formatting.
Also, keep in mind that TDesktop is part of Telegram, so you can't just add some local TDesktop specific hack if Telegram doesn't want to have that feature -- that won't work.

@stek29 All I did above was debunk misinformation repeatedly posted by you, suggesting that markup-based text formatting is "impossible" _due to "server limitations"_. Clearly, it can be technically achieved by clients only, without ever consulting the server — which I demonstrated.

Now, having set the above straight, I'm not going to dwell into an off-topic discussion based solely on speculations and not facts, so you might just as well have not tried to start it ;-) But have a nice day!

@pureby It just isn't done yet, sorry.

@john-preston Thanks for setting the record straight! :-)

@pureby

debunk misinformation repeatedly posted by you

What misinformation?

stek29 commented on May 14, 2016

Then ask server dev to allow it

stek29 commented on Oct 6, 2016

yeah, formatting is finally allowed on server side.

And about your "solution"

the server doesn't have to be involved at all. It is enough to simply instruct the client to interpret certain combination of raw symbols as formatted text.

Think again about purpose of this tracker and purpose of TDesktop before suggesting solutions like this. I personally recommend reading this comment.

@stek29 I recommend you stop pretending like you're _some kind of_ TG official.

We have received a definite answer from _the_ developer: it's not _"impossible",_ it's not a _"server issue"_ — none of the stuff you have repeatedly suggested. It is simply not done _yet,_ because there's a lot of work to do. Which I respect fully and greatly.

This discussion is over.

@pureby It __was__ impossible, because it __was__ server issue -- at __the time I said__ it was.
I'm TG official, but I tend to speak out what I think and what I know -- that's why comments exist.
And sometimes I can know a bit more about TG than others -- I can try to send formatted text from my account using API directly, and notice it won't work.
Then I tell it to people, so they don't blame __the__ developer for not implementing this.

I've made some (minor) contributions to TDesktop, and I try to help _the_ developer and _the_ auchri by looking through reports, finding duplicates, and doing other things I can do.
But I can't find even comments on issues from you (except this one).
You came from nowhere and started saying I was lying, without even trying to make a research or something. But I can give you a brief history of "formatting without bots" feature in TG.

First official client to support formatting without bots was Webogram, and it was added in zhukov/webogram@68f9e5da778a5c48e5929a96e3b359aa01d24d01 (have a look at commit author).

Before that I _(and other people ofc)_ was asking team for formating without bots, was reminding team about this feature -- since I was accepted to TSF and even before.

So no, I'm not TG official, but maybe, just maybe, I know _more_ about TG _than_ you do.

Anyways, our conversation has nothing to do with this issue report, and you're right -- This discussion is over.
But I decided to post this comment anyways to give you a chance to start blaming me for disinformation in year or two when something stated in it changes, just as you did with my previous comments about this being server side issue.

Oh, and speaking about definite answer from _the_ developer:
image

@stek29 Viktor, I apologize sincerely. I didn't realize the amount of time you put into technical assistance, nor the amount of knowledge you have about Telegram (which indeed turns out to be more than mine). I guess I was provoked into a fight too easily, but then I realized that I'm fighting a person who is actually _helping_ to make the best messaging app for my phone and desktop, which in turn makes communication between me and my loved ones secure, fun and accessible from every device.

Thank you for keeping your cool and staying polite and professional while I tried to provoke you. It took me some unrelated personal blunder and your long and polite reply to realize that what I was doing past months was unjust and stupid, and I hope that you will accept my apology and we get along from now on.

Testing Android official app for Arabic text;
__Italic__ text works fine but bold doesn't.
Arabic bold text is displayed the same as normal text.

Will we ever get ~~strikethrough~~?

@pureby it's not supported on server side, ping Telegram on Twitter or ask in-app support

Whow! There is awesome code-snipped support via `
and code block support with ``` 👍👍 And thats already in for as long as I remember!

But *bold* and __italic__ have to be done via @bold which you can't just type but you have to wait for a popup where you choose the "custom markdown" ... ☹️
This seems overly complicated giving that Threema and WhatsApp support this for ages already without any hassle.

@ewerybody You can use bold and italic with double * or double _

@ewerybody ...without an bot

Ah nice! At least something! Since when is that in?
And where is the documentation for that?

I see this is closed, but with what syntax is link formatting supported?

@AndydeCleyre no, links are rejected by server unless you're a bot.

Here's currently supported format:

  • bold : **bold**
  • _italic_ : __italic__
  • code : `code`
  • pre : ```pre``` (supports multiline)

There's currently no way to have nested formatting, it's API limitation.

There's currently no way to disable text formatting, except using nested formatting hack. Escaping doesn't work. See #2683.

I'm locking this issue. Feel free to open new issues related to text formatting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

whywhyy picture whywhyy  ·  3Comments

Yanrishatum picture Yanrishatum  ·  3Comments

abhyrz picture abhyrz  ·  3Comments

beppe9000 picture beppe9000  ·  3Comments

ghost picture ghost  ·  3Comments