lionleaf / dwitter

Social network for short js demos
https://www.dwitter.net
Apache License 2.0
766 stars 69 forks source link

Add syntax highlighting #395

Open dwitterer opened 6 years ago

dwitterer commented 6 years ago

This was previously discussed in #247, but it seems that noone has actually gotten round to implementing this. Therefore, I opened a seperate issue for this, well... issue, as per @lionleaf's request (and common sense).

The basic gist:

Easy stuff to do - we just need to source highlight.js and use it on code blocks, updating on every newCode, but we kinda abandoned the idea, so... here we are again.

dwitterer commented 6 years ago

If anyone does feel like doing something more, however, then a bracket matcher would also be great. This would basically just check if the character behind the caret is a ( or ) and look back for the previous/next matching bracket accordingly. In Atom, for example, it looks like this (you might have to enlarge the image quite a lot - github compression screwed up the image quite badly):

screenshot from 2018-09-14 21-12-28

imscary commented 6 years ago

I was going to create this issue too! Syntax Highlighting will make that text area look awesome. Highlight.js is the best here in my opinion.

joeytwiddle commented 5 years ago

99 also had some suggestions:

MostlyEmre commented 2 years ago

Syntax highlighting seems to be added in beta.dwitter.net