On 04/20/2012 11:41 PM, XWisdom wrote:
> my problem is that the code I'm trying to highlight consist of
> different languages and formats such as HTTP requests and responses,
> JSON data, XML etc. But the parser parse everything as "ruby". Because
> the code is coming from an external source, I can't tell them to add
> the appropriate<code class=""> to each section, so I'm just trying to
> surround the blocks that parser don't understand (HTTP Response/
> Requests) with "no-highlight" so it doesn't get parsed.
OK, I got it. It won't work this way because highlight.js highlights a
single block of code with a single language. So if you have something like:
<code>
// this is some json:
{ ... }
// this is HTML:
<div> ... </div>
</code>
It's not going to work. The only way to highlight snippets in different
languages is to have each snippet in its own container (no matter which
tag). Is this how you have them? Even better, could you paste a short
example here?