Off topic sorta, but what would be the easiest (PHP?) way to detect and make PHP run everything inside of
<pre><code></code></pre>
and put it into htmlentities?
I put my blog article entirely in HTML so I can’t have ALL of it running htmlentities. I need to search within this string and only htmlentities a small part.
Also, anyone knowing how to get highlightjs to run multiple code samples in one section would be appreciated. Perhaps two
I was just thinking and it all has to be one pre/code block due to a row counter I have. Using two separate ones resets the counter. Also I have the code section modifiable (contenteditable=true) and two separate ones would have two separate regions. Not very good.
So I need something to insert into my pre/code section which will make highlightjs try and re-find what language it is. Perhaps this is something I need to modify myself.
Edit-Just opened up the highlight pack.js file…Dear lord…
I modified my post some - see above. One second while I get an example up. I’ll edit this post.
www. codefun damentals.com/test.php (tired of being TL3 and having my links being followed and generating 404s in my webmaster log. Too lazy to rewrite )
Note that if you look at the source. I have two pre/code blocks in there. Remove the second one (to only have one) and you’ll see the CSS is completely unstyled. Since the highlightjs thinks the entire block is HTML.
Yes, it’s because, as I said, I have them in two separate pre/code. However, the numbering on the left is screwed up. Also, dpending if you clicked the HTML or the CSS, you’d have two editable fields (because of my contenteditable=true in my HTML for each block.)
I’ll make it one big block now. Please refresh the page.
Can you throw up a page the original way that had two separate blocks and the line numbers were different? I’m wondering if setting counter-reset would solve it.
I can do without the contenteditible crap…but the codecounter needs to be reworked to where it’s not looking inside of the CODE, per say. It needs to count the number of CODE blocks, remember the previous line numbe it was on, and go from there. I’m moving this to the Javascript section. Hopefully someone can rework this.
I’d also like this to take into account lines which wrap. I’d like a second number given depending on if it wraps once…twice (2 line numbers) etc.
Perhaps @James_Hibbard or another JS guru can get in here.
Hmm, wait. Perhaps I could, in JS, set that attribute like you were talking about @cpradio. What do ou think about an if statement which detects whether a future code block exists. If so, then set a number to start at? Did you try that? Not sure what you all tried.