- This topic is empty.
April 1, 2012 at 1:48 pm #37442April 1, 2012 at 2:29 pm #100402
According to the Prettify usage FAQ:
Put code snippets in
...and it will automatically be pretty printed.
Would that help?April 1, 2012 at 3:17 pm #100405
I tried that way, but still nothing. I don’t think the problem is prettify, cause it doesn’t work either without any classes applied.
What happens is that the html inside pre tags is still considered as html, so if I have for example:
What I get is a div element on my page, when I should be getting just this text: <div><!–html–></div> so prettify could style it properly.April 1, 2012 at 3:30 pm #100406
If you look at this very page and how the code blocks are styled: the PRE tags are still in the markup (with class “prettify”), used as the container, and everything in it is styled through CSS.
I have no experience with Prettify so I’m not sure if that’s the way it works, but I’m just going after what I see on CSS-tricks.April 1, 2012 at 3:45 pm #100409
Wow, you’re fast!
I think I wasn’t clear. Let’s forget prettify. The
codetags should appear in the markup, but the
divshould’t be a “real” div, it should be just text.April 1, 2012 at 4:01 pm #100410
Right, but to replace the
<isn't that exactly what Prettify does? If those characters are not replaced, then maybe the prettify script is not loaded properly.
Or maybe I should just leave this to the Prettify experts.April 1, 2012 at 4:33 pm #100413
It doesn’t replace the
<. It wraps the
spanwith a class
This is inside the
codetag:April 1, 2012 at 4:34 pm #100414April 2, 2012 at 2:16 am #100438
Ah ha! I’m so stupid hahah. The thing that was troubling me was that in the inspector doesn’t appear the < and >, so I thought there was a way to avoid using the entities.
Thanks both of you for your help!
- The forum ‘Other’ is closed to new topics and replies.