-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically Syntax-Highlight received Code #250
Comments
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. |
@GreatMedivack you just had to be different to everone else ⬆️ |
+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 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. |
+1 highlight syntax like in gitter |
It's worth noting that it's now possible to format code blocks by using the |
@joeldrapper |
@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 |
I love the ``` block and I use it a lot, but syntax highlighting will be a new level. |
A related development: tok, an early telegram client from the kde group, recently added this feature, though I haven't tested it. |
There's a vscode extension for telegram I'd love to use, but it's a fairly pointless if such basic features aren't supported. |
for me it returns nothing :( |
What version are you running? I've got 1.60.2 |
VSCodium 1.59.0 |
Could be related to VSCodium/vscodium#448 |
Please, add Syntax-Highlight |
Just here to also bump the request of Syntax-highlight. |
+1 for this feature! |
+1 for manual code block: ```language |
It's coming? 🤔🙏 |
It's done in some way. In the upcoming version you'll be able to specify language after triple-tick: ```cpp Then it'll be a usual monospace block but with some syntax highlighting on top. It won't be supported in the message input field (at least for now, maybe ever), but some improvements may come when there is more time for that. |
Lines will break as before, implementing a horizontal scroll for a part of a message in the middle of the message bubble is something really complex and not planned right now. |
@john-preston I've tried current build. Bugs: |
@kirsan31 I see, prism.js has aliases for languages, that aren't handled in the libprisma fork. Thanks for pointing that out. Last bracer is a bug, thanks, fixed in code. |
@john-preston , first of all thank you so much for this feature! Looks really good, but there are a few remarks:
|
|
@Piterden So what languages are supported. There is no doco anywhere and once I find out I can update. Since you mentioned highlight.js I take it these then? https://highlightjs.org/ |
|
This list includes Factor, but I don't get any highlighting for that in the latest Android app. EDIT: I just tested on the desktop app, where it does color strings and numbers (only?) for Factor. |
Speaking of Android app, I immediately noticed that syntax colors differ between desktop and mobile app. I even applied my custom "desktop" theme on the smartphone, and it still shows different colors on the same message with a code. I checked and didn't see any color values that are applied to the code. So these code color schemes are platform dependent. This is not what I expected. And I want to say that Android colors are better (at least green color for So, adding a list of color schemes would be a huge feature. Imagine, every dev will see the same code message (in a group chat) in the color scheme that they want. This would be amazing. But it would require a separate menu (section) with a variety of color schemes, including custom ones. But if this is too ambitious, then a set of values in theme's color palette, which are specific for each code token type (string, number, keyword etc.), would do the trick. |
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
The text was updated successfully, but these errors were encountered: