Code52 / DownmarkerWPF

MarkPad - a visual Markdown editor (inspired by the Downmarker project)
http://code52.org/DownmarkerWPF/
Microsoft Public License
1.4k stars 459 forks source link

SyntaxHighlighter Support #61

Open rposbo opened 12 years ago

rposbo commented 12 years ago

Can you introduce support for Alex Gorbatchev's SyntaxHighlighter (https://github.com/alexgorbatchev/SyntaxHighlighter) in the preview window?

ghost commented 12 years ago

To initial SyntaxHighlighter, am I right in assuming you need to have something like class="brush: php; highlight: [5, 15]; html-script: true" on the code blocks to get it to trigger, compared to Prettify which works on any old code block?

The latter "just works", the former gives you a lot more control over the language being highlighted.

ghost commented 12 years ago

Oh, my bad, Prettify is meant to be on particular classes too. I got around that on my blog with a bit of JS, maybe the same can be done of SyntaxHighlighter

rposbo commented 12 years ago

syntaxhighlighter allows you to use really simple tags to enable language-specific highlighting; e.g., [powershell][/powershell] and [csharp][/csharp]

I use this a lot on my blog and always use WLW to write the posts and then log in to Wordpress to edit the post to add in the code highlighting. Annoying. I might just be a case of popping in the syntaxhighlighter js into the preview area of markpad; I'll have a looksee myself, just in case.