StackExchange / pagedown

The Markdown editor and converter used on Stack Overflow and the other Stack Exchange sites
Other
417 stars 81 forks source link

Syntax highlight for source code #101

Open FranklinYu opened 5 years ago

FranklinYu commented 5 years ago

This is a feature request. It would be awesome if the Markdown code in editor can be syntax-highlighted.

MarqueIV commented 4 years ago

Isn't that more a feature of formatting the outputted HTML code blocks itself? Take a look around there and I think you'll see you can add some js to your site that will format them. Then you simply use Markdown to define your code blocks by either indenting one space, or putting it between triple backticks. The advantage of the latter is usually you can tack on the language for that block right there so you can have multi-language formatting (or remove it entirely) per-block.