While I was putting together a new blog post about customizing the Web API Help page I took a look at how to display code in Blogger. SyntaxHighlighter is a popular tool for highlighting code in your blog posts which uses Javascript files and CSS to modify code snippets.
I followed this quick guide to using SyntaxHighlighter with Blogger (tip: don't add script references to brushes that you're not using!) and was generally pleased with the results but sad that no Razor brush is available. After a quick dabble however I have created a quick and dirty
Razor brush for SyntaxHighlighter which I hope people find useful!
Example razor syntax:
Very userful! I use it in my blog thanks.
ReplyDeletereturnsmart.blogspot.com
Nice one. I was looking for it.
ReplyDeleteThank you :)
Ya man! Very useful. Everyones got C# but they forget about the Razor highlighting in cshtml pages. I used it CMS where people can write views without needing to publish. THis helped me allot ! Thanks
ReplyDeleteThere's a bug in this brush script. Towards the end of the script is the line
ReplyDeleteSyntaxHighlighter.brushes.Xml = Brush;
This causes problems if you're referencing the XML brush on the same page.
There's a simple fix: change that above line to
SyntaxHighlighter.brushes.Razor = Brush;
Presumably this bug has been introduced by the author copying the contents of the XML brush and then modifying it for the Razor syntax.
Otherwise it's a great addition - my thanks to the author.
hi plz suggest how to use it
Deleteit's greate i have been searching for months
ReplyDeletefor my blog.
www.mitechdev.com
hi i am getting
ReplyDeleteError parsing XML, line 91, column 33: The content of elements must consist of well-formed character data or markup.
errors while saving my blogger template after addition of above razor brush
please help me.
Caution. There is a bug in Alex's script due to the addition of Razor syntax: https://stackoverflow.com/questions/27258554/syntax-highlighter-cant-find-brush-for-xml
ReplyDeleteYes thanks, this was actually fixed in the file download a few years back! However since then, Alex has made a lot of refactoring to the code so it would probably be worth checking out his latest code base: https://github.com/syntaxhighlighter
Delete2021 ford escape titanium hybrid - Tiagettech
ReplyDelete2021 is upon us. Today we titanium canteen are at the launch of black titanium fallout 76 a titanium meaning new, innovative titanium block gaming concept called “The Ultimate Guide to Hybrid Casinos and Slots,” with the launch titanium bicycle