r/C_Programming • • Jul 10 '16

Question Syntax highlighting on Reddit

Considering how much code gets posted here as plain text, wouldn't it be great if we could have a way to define what part of text is code and have it automatically highlighted? Or is this not possible on Reddit?

29 Upvotes

31 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jul 11 '16

Automatic highlighting is almost certainly impossible, but it should be possible to create a tool that takes in code and spits out some unholy combination of Markdown, which you'd then be able to style using CSS. It's also possible to build a bot that automatically does that. /r/math for example uses userscripts to turn inline TeX into nice images.

All in all, it's probably quite a lot of work, and I'm not entirely convinced that it's worth it.