PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Code tag "bug"...

Hi.

I have a small "issue" with the HTML that the code tags produce.

I browse on a text browser during the day, and it represents code like this:


12 0
13 ;
14
15
16 if
17 (
18 +
19 +
20 framecount
21 >
22 frameskip
23 )
24
25 {
26
27 if
28
29 (
30 !
31 NoRender
32 )
33
{

if

(
!

(i.e. one parsed token per line).

I replaced the DIV tags around the code tokens with SPAN tags, and the output is correct, both in local graphical browsers, and the terminal-based browser I use to surf PocketMatrix (don't ask why I have to use a terminal, it's a long story :().

So, I was wondering if the code plug-in could be modified to use SPAN tags rather than DIV tags for the code? If my reading of the HTML spec. is correct, then logically the code tokens should be in SPANs anyway, not DIVs. :)

(from elsewhere on the Internet:


The <div> tag acts as a paragraph break, because it is defining a logical division in the document.
)

Thanks guys. :)
Well, it only took me a year to get around to this, but I made that change to the syntactic coloring script.

So, what is needed now is for all you people with various browsers to test it - particularly those who see problems with the existing version. You can go here to give it a try:

http://www.dexplor.com/test

You can copy / paste this code in if you need something to test with:

#include "test"

//this is a test
for (int i=0; i<10; i++)
i++;

Please post your results here. Thanks!

Dan East
IT WORKS!

Mozilla Firebird, one of the latest nightly builds.
It's working better than before under Mozilla Firebird, but the colours aren't showing up and the default font is being used instead of Courier New.
I just had a quick look at the HTML and I've found a few obvious problems. Use colons in style tags, not equal signs. HTML tag attributes should be opened with double quotation marks, not single marks. Single marks should be used within HTML tag attributes.

It might be a good idea to run the output through the W3 HTML checker as well.

Anyway, thanks for your effort Dan. It's going to make reading topics in the developer forums easier from now on :).
Your right Thomas, I didn't even notice that, I was giddy in glee when it didn't strech the page down like it did before.
Chris Edwards · 24 Jun 2003, 05:43 UTC
Ok, I just updated the style tags with the proper syntax. The colours and font-style stuff should be working correctly now.
Dan: It's almost working now. See the attached screenshot below (running the latest Safari for Mac OS X)...

Image

//Johan
That is a problem with the wrapper for the code block. Chris whipped that up to have a horizontal scroll bar for wide code blocks. Any ideas Chris?

Dan East
BTW, this shows exactly why programmers shouldn't do HTML. "It works perfect in my browser, so your browser just sucks".

Dan East
Oh so true...
Dan: The code can be fully contained within the normal box, and the page would still strech horizontally. I checked this out with one thread, the code was slightly past the page border, but there was still a good 500-600 pixels of extra space.
It doesn't work that way with IE. The code box will never increase the width of the page beyond the normal width. The code box should have its own vertical and horizontal scrollbars if it is larger than a certain size.

Dan East
I don't see anything within the code tags on IE5. And, I mean, IE5-win is about the best conforming browser out there, as far as CSS in concerned. :wink:
Chris Edwards · 07 Nov 2003, 00:02 UTC
IE6 will fix it.

Which makes IE6 "about the best conforming browser out there, as far as CSS in concerned" ;)