[code] coloring breaks [color]

This is a discussion on [code] coloring breaks [color] within the General Discussions forums, part of the Community Boards category; The new [code] line numbering + coloring thing breaks [color] tags. It's also doing something weird. It won't line number ...

[code] coloring breaks [color]

The new [code] line numbering + coloring thing breaks [color] tags. It's also doing something weird. It won't line number it unless I SHIFT+RELOAD the page, after I post. It has the normal old code tags where color tags work, but if I shift+reload, it switches to the other format, and breaks the color tags, turning them into HTML font tags.

Code:

int main( void )
{
return0;
}

Actually, it doesn't quite have the old style. The box around the whole thing is gone for me.

The old code tag box is gone (temporarily?) because I had to change the CSS class of the code box to make the syntax highlighting plugin detect the code--probably some restyling will want to happen. My guess regarding the issue you're seeing with needing to force a refresh is that the forum isn't reloading the page when a quick-reply happens, but is instead using Ajax, so the syntax highlighter isn't triggering. I'll have to play around a little bit to see how to make this work, but I'm guessing it's possible.

The broken color coding seems like it is probably an effect of how the syntax highlighter is working--it looks like it is splitting the html tag for the HTML color coding with its own tags:

Well, I assume you are talking about the feature, and I like it, but it needs some work with the colors.

The biggest thing is native types (int, float, etc.) don't have enough contrast for the size of the text. It is passable on a normal computer monitor, but on my mobile "Firefox", I literally barely see what's happening.

I think that's a bit too "clever". Perhaps [code] for the new code block and a special flag for people who don't want it, such as [code=plain] where the code block is what we've been using.

Presuming the issue is too difficult to fix, won't that break old posts? I think syntax highlighting is worthwhile regardless, but it might be better to either make the default no highlighting, or hack vBulletin so that the default for posts older than yesterday is no highlighting.

Presuming the issue is too difficult to fix, won't that break old posts? I think syntax highlighting is worthwhile regardless, but it might be better to either make the default no highlighting, or hack vBulletin so that the default for posts older than yesterday is no highlighting.

I would tend to agree with this one. All the old code I posted using my syntax highlighter is now broken and unreadable.

1) Make it so that code regions that are hand-colored by users (in any way) are ignored by the highlighter. If this works, I'm not sure it will be necessary to have a separate [code=plain] option.
2) The colors need to be tweaked. I'll work on this once the breakage issues are resolved.
3) I also like the idea of having an option to disable the highlighting for users who don't want it. Either a per-code-box button or a user setting.
4) The contexts where it doesn't currently work need to be fixed--lower priority for now, as long as #1 is resolved satisfactorily.

For the moment, I am going to disable highlighting until I've fixed issue #1 and then, once resolved, try to get reasonable colors.

1) Make it so that code regions that are hand-colored by users (in any way) are ignored by the highlighter. If this works, I'm not sure it will be necessary to have a separate [code=plain] option.
3) I also like the idea of having an option to disable the highlighting for users who don't want it. Either a per-code-box button or a user setting.

How about a new bbs tag... [pre] [/pre] to allow us to insert preformatted text that's not syntax highlighted?