zhukov / webogram

Telegram web application, GPL v3
https://web.telegram.org
GNU General Public License v3.0
7.94k stars 2.36k forks source link

Syntax highlighting in code blocks #919

Open maximal opened 8 years ago

maximal commented 8 years ago

If we have code blocks, it would be useful to highlight syntax.

In my opinion, the best tool for that is highlight.js: https://highlightjs.org/

It detects the language automatically. But we should have an ability to specify the language explicitly. For example, Markdown-wise:

```html
<div>
    <span></span>
</div>
dellagustin commented 8 years ago

there is also prismjs: http://prismjs.com/ But it does not have language detection.

maximal commented 8 years ago

I personally love highlight.js and appreciate the work of its author, @isagalaev.

dellagustin commented 8 years ago

To be honest I din't know it until I saw it in your issue. It looks interesting. I have used prism in a development of mine, but for a specific language.