Tdesktop: Unwanted feature - string replacements make sending plaintext code difficult

Created on 25 Feb 2016  Â·  8Comments  Â·  Source: telegramdesktop/tdesktop

Noticed that copy and pasting code often causes nightmares for the recipient.

If a line includes double characters of any sort in the middle of two pieces of text it mashes them together

Example:
2 x Less Than Sign (<) becomes Double Left Pointing Angle («)
2 x Hyphen becomes Em Dash

See here:

test -- this

becomes

test — this

and

test << this >>

becomes

test « this »

If the characters are on the start of the line, it doesn't occur.

This makes it super annoying for coders.
Yeah, I know I could use Slack like the cool kids (I do like Slack)... alas, I enjoy Telegram.

duplicate

Most helpful comment

And how do I paste text containing ``` characters without Telegram treating them specially?

I'd really like to have an option to disable text processing so I could paste anything and it would be sent as is.

All 8 comments

@timkrins You can use triple-backtick wrap for code parts, it won't have those replaces and will use a mono space font. like that

Oh interesting. Cheers for that.

Any chance of a "paste as code" right-click option if the clipboard
contains code-like characters?

@timkrins And what is "code-like characters"?

Oof... Asking the hard questions... I like you Telegram.

Maybe just detecting pasting characters that are going to be mashed
together by the string replacement function?

Short of some crazy heuristic algorithm then I'm not sure ;)

I think the manual wrapping in ``` is fine, however I'm wondering why the replacement is there in the first place? I think it's the only official client that does it and I don't see where it adds any value.

Duplicate #522

And how do I paste text containing ``` characters without Telegram treating them specially?

I'd really like to have an option to disable text processing so I could paste anything and it would be sent as is.

@shadowlmd is crucially on point here. This makes impossible a simple behavior that many users want -- send the text we type, not what a developer prefers that the stranger types.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liudvikas picture Liudvikas  Â·  3Comments

TotalKrill picture TotalKrill  Â·  3Comments

Yanrishatum picture Yanrishatum  Â·  3Comments

matteotumiati picture matteotumiati  Â·  3Comments

FunctionalHacker picture FunctionalHacker  Â·  3Comments