hack.chat
hack.chat copied to clipboard
Feature req: Code syntax highlighting?
The whitespace is already preserved, so another enhancement to the viewing of code might be cool.
You mean like a <code ... /> feature where you could hide code snippets ?
Perhaps ``` can be used to surround code in the textbox to trigger this behavior.
I know its python, but might be considered as a reference: http://pygments.org/faq/ and http://ralphminderhoud.com/posts/pelican-theme-syntax-highlighting/
Its not really syntax highlighting, but it is on my to do list;
this is done with the plugin for hack.chat: https://github.com/ToastyStoemp/Hack.Chat-Enhancement-kit
Indenting the code with 4 spaces should also work to comply with markdown standard and the websites using it.
I like the design of @ToastyStoemp's code block. Should ``` or four-spaces (or both) be used for syntax highlighting?
Edit: I like the triple-tilde syntax since I can modify the behavior of the Enter key to insert a newline instead of submitting the message inside a ``` block. Also it's easier to paste code that doesn't already have indentation. And I don't really care about the Markdown standard.
The plugin uses
//code
at the moment, longer code snippets, longer then 15 lines, are included with a scroll bar: