| | |
New Format - Code tag options
![]() |
•
•
Join Date: Jan 2008
Posts: 3,812
Reputation:
Solved Threads: 501
I see a potential problem with the new format regarding code tags. Before, you had the option of doing this:
[code]
// paste code here - Courier-style fomatting, multiple spaces allowed, but no line numbers or syntax highlighting.
[/code]
or this:
[code=cplusplus]
// paste code here - Courier-style fomatting, multiple spaces allowed, line numbers and syntax highlighting.
[/code]
Both had their place. Very often I would choose to use the non-syntax specific code tags since I wanted to highlight something in red or because something was pseudocode rather than code and I didn't want the syntax highlighting, or it perhaps wasn't code at all, but I wanted something that would preserve the spacing and [quote] tags wouldn't do because they tend to disappear when replying to replies.
This option has apparently disappeared. When you type in:
[code]
[/code]
if you are in the C++ forum, you get the line numbers and syntax highlighting. I just posted on a new thread, saw it was happening, and changed it. But you have a whole bunch of old posts that look bad now, like this one:
http://www.daniweb.com/forums/post965858-19.html
You get stuff like this now:
coupled with instructions to look at the red line, which is no longer red.
Any way we can change back to the old way, without automatic language-specific syntax highlighting, or at least only make it automatic when parsing NEW threads?
[code]
// paste code here - Courier-style fomatting, multiple spaces allowed, but no line numbers or syntax highlighting.
[/code]
or this:
[code=cplusplus]
// paste code here - Courier-style fomatting, multiple spaces allowed, line numbers and syntax highlighting.
[/code]
Both had their place. Very often I would choose to use the non-syntax specific code tags since I wanted to highlight something in red or because something was pseudocode rather than code and I didn't want the syntax highlighting, or it perhaps wasn't code at all, but I wanted something that would preserve the spacing and [quote] tags wouldn't do because they tend to disappear when replying to replies.
This option has apparently disappeared. When you type in:
[code]
[/code]
if you are in the C++ forum, you get the line numbers and syntax highlighting. I just posted on a new thread, saw it was happening, and changed it. But you have a whole bunch of old posts that look bad now, like this one:
http://www.daniweb.com/forums/post965858-19.html
You get stuff like this now:
•
•
•
•
<span style="color:Red">cout << "i = " << i << " Decrementing lCount\n"; </span>
Any way we can change back to the old way, without automatic language-specific syntax highlighting, or at least only make it automatic when parsing NEW threads?
This ended up being a bug. I haven't yet had a chance to go over the new functionality of the code tags with everyone yet, but basically they are smart enough to know that if you're trying to use bbcode, don't force a language.
•
•
Join Date: Jan 2008
Posts: 3,812
Reputation:
Solved Threads: 501
Seems to parse fine if you go to the entire thread and read it, but not if you click on a particular post within the thread:
http://www.daniweb.com/forums/post965858.html
Go to thread 19 in the thread in this post and it parses with the non-language-specific code tags. Click on the post itself though, as I did when linking the first post on this thread, and language-specific code tags are added. The same post is parsed differently.
http://www.daniweb.com/forums/post965858.html
Go to thread 19 in the thread in this post and it parses with the non-language-specific code tags. Click on the post itself though, as I did when linking the first post on this thread, and language-specific code tags are added. The same post is parsed differently.
•
•
Join Date: Jan 2008
Posts: 3,812
Reputation:
Solved Threads: 501
The one I listed now works, but the problem remains for others, like this random thread I picked from the C++ forum just now.
http://www.daniweb.com/forums/thread220826.html
Same behavior as the prior thread I listed. See post 4. Code is in non-specific code tags and parses as such when viewing the full thread, but if you view it as a single thread and it parses to C++ syntax tags. I hit "Reply with quote" to see the underlying post and it was [code][/code] not [code=cplusplus][/code].
http://www.daniweb.com/forums/thread220826.html
Same behavior as the prior thread I listed. See post 4. Code is in non-specific code tags and parses as such when viewing the full thread, but if you view it as a single thread and it parses to C++ syntax tags. I hit "Reply with quote" to see the underlying post and it was [code][/code] not [code=cplusplus][/code].
That post was created while I was in the middle of fixing things so its cache got screwed up. Have a LOT on my plate right now so going to finish everything and then clear the cache one last time.
•
•
•
•
I'm still noticing in the C++ section that [code][/code] is adding line numbers and saying "C++ Syntax". It's not supposed to do that, correct?
You can get around that behavior. Take a look at this post:
http://www.daniweb.com/forums/post98...tml#post981568
•
•
Join Date: Jan 2008
Posts: 3,812
Reputation:
Solved Threads: 501
•
•
•
•
Vernon,
You can get around that behavior. Take a look at this post:
http://www.daniweb.com/forums/post98...tml#post981568
Yeah, I just tried that in the C++ forum. Tried to post this:
[code][B][/B]./calcAverage 5 8 1 4[/code]
It added the C++ code tags, I would imagine since there's nothing to be bolded. Stick an empty space in between the Bold tags and that has no effect. Stick a printable character in between the Bold tags and it has the effect you mentioned. What if you want nothing bolded, as I did not?
I like it better the old way, where nothing was assumed and language-specific code tags were added only at the poster's option. Gives you more control of the post. Worse, the changes are retroactive. Posts prior to the change have the syntax added where it wasn't intended. I'm seeing it all over the place. Here's one of my old threads, chosen at random, See the bottom part of post 1. Syntax has been added where none was intended, so it doesn't look very good.
http://www.daniweb.com/forums/thread147949.html
Can pre-change posts at least no longer be parsed this way? Check the post date and see if it was pre-change and parse it differently based on that?
You can do [code=text] to disable syntax highlighting completely:
Anyway, I'm not digging the way these new code tags are handling things. They're not even backwards compatible with the old language tags (cplusplus, csharp, etc), and there were A LOT of posts that used code tags for stuff that wasn't 'code' (or wasn't the language of the forum). Thanks to the new parsing method, all these posts are going to be screwed up as VernonDozier mentioned.
text Syntax (Toggle Plain Text)
./calcAverage 5 8 1 4
Anyway, I'm not digging the way these new code tags are handling things. They're not even backwards compatible with the old language tags (cplusplus, csharp, etc), and there were A LOT of posts that used code tags for stuff that wasn't 'code' (or wasn't the language of the forum). Thanks to the new parsing method, all these posts are going to be screwed up as VernonDozier mentioned.
"Technological progress is like an axe in the hands of a pathological criminal."
![]() |
Other Threads in the DaniWeb Community Feedback Forum
- Previous Thread: Nick Complete
- Next Thread: Avatar size limits
| Thread Tools | Search this Thread |








