tdesktop
tdesktop copied to clipboard
Automatically Syntax-Highlight received Code
It would be great if we were able to send code snippets via Telegram in a way that is nicely readable by the receiver. I'm chatting a lot with other developers and often, I feel the need for such a feature.
Related issue on the Telegram bug tracker: https://bugs.telegram.org/c/824
Also, support for GitHub's Markdown would be a wise feature.
Code highlighting, or at least tabulation, would be awesome
The thing is, highlighted code doesn't have to be a new message format like images or videos as it's also just text. It could be marked like code in GitHub flavoured Markdown using three backticks or something like that.
or just by using some library that detects most common programming structures, there is probably some library made to detect code inserted between text
I'll also appreciate this !
code here
will be a nice addition
I like the idea. I'm waiting for later versions of Telegram to see whether I need Kik Messenger installed on my phone or not. Please keep doing well developers.
I absolutely agree. Syntax highlighting is very useful thing
I disagree about automatic mode. Should be some markup language like [code]int main()...[/code] instead of automatic to avoid bugs and excessive CPU consumption on parsing messages.
Nice Feature, Like that ;)
I would love that support! A markdown support as in GitHub or on HabitRPG's chat would solve well the problem about a non-dev sending a sample message and te app reading it as source code.
I know telegram is a mobile-first application, but we already have this kind of functionality in other chat tools like slack that use it in both mobile and desktop implementation. This kind of markdown language would really help telegram to be adopted by technical teams on internal communication. I am trying to convince my team to replace slack and skype by telegram and this feature would help me a lot on this task! Keep doing this great work!
@GreatMedivack you just had to be different to everone else :arrow_up:
+1 from me and +1 from my cat
What would be the best way to handle this? Slack does code highlighting, but its not markdown style, rather code upload. UX matters too.
+1 for the same system as Github, backticks with the language code behind, would be super useful
This was implemented, check this out:
Inline `code` has `back-ticks around` it.
```
var s = "Block highlighting";
alert(s);
```
This is just the monospace, not Syntax-Highlight. And if a line have more than 51 characters, it breaks the line (if was even the 80 chars i would understand...but why 51?). And the mobile still not working well. If the feature is already implemented, it need some improves.
+1 highlight syntax like in gitter
It's worth noting that it's now possible to format code blocks by using the @bold
bot which accepts markdown.
@joeldrapper @bold
didn't support syntax highlighting and use word breaking to separate line. It's makes code more unreadable if you send some example to man for showing some example, it's hard to read and still better sending code with pastebin. It's needs horizontal scroll at minimum, but i don't know, support it's telegram or not.
@Niklan Currently TDesktop does not support horizontal scroll in messages layout :(
Has no way to embed Pastebins links? However, a native option will be great.
If inline-bot is the preferred ways for bold & italic... then we will probably have to resort to inline-bot for this "programmer only" case?
@lawrencegs Could be inline-bots a way to do this, but the API don't have a implement to modify colors in text. It has only a simple markdown.
I love the ``` block and I use it a lot, but syntax highlighting will be a new level.
Well, I'm upping this since it would be really lovely and useful :+1:
@Niklan Indeed, we need resizable chat width at least. I commented about it here: https://github.com/telegramdesktop/tdesktop/issues/1634#issuecomment-194929183
Use the new reactions of GitHub on the first entry of this issue instead of creating unnecessary +1
comments.
Reactions aren't available in mobile site yet.
@stek29 I know - but you can easily switch to the desktop version.