Highlight inside the code block


#1

Currently I use Rouge to highlight my code. What I want to do is to be able to highlight some code with bold/red inside the code block.
Any ideas how could I do that?
Thanks!


#2

I don’t think that is supported at the moment though maybe it is on their radar?

https://github.com/jneen/rouge/issues/617


#3

Possible alternative is to use Prism instead. It has support for highlighting specific lines of code.

http://prismjs.com/plugins/line-highlight/


#4

Thanks for suggestion! It looks interesting, however I failed to describe what I really want to achieve. I would like to highlight specific words (not lines) inside the code block. In fact, I would even agree to drop syntax highlighting at all to get this feature.
So basically the requirements are: block of text with a monospace font + highlight any words I need. Any ideas how could I do that?