943,922 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Sep 5th, 2009
0

New Format - Code tag options

Expand Post »
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:

Quote ...
<span style="color:Red">cout << "i = " << i << " Decrementing lCount\n"; </span>
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?
Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,375 posts
since Jan 2008
Sep 5th, 2009
0

Re: New Format - Code tag options

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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 5th, 2009
0

Re: New Format - Code tag options

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.
Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,375 posts
since Jan 2008
Sep 5th, 2009
0

Re: New Format - Code tag options

Cache cleared
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 6th, 2009
0

Re: New Format - Code tag options

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].
Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,375 posts
since Jan 2008
Sep 6th, 2009
0

Re: New Format - Code tag options

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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 11th, 2009
0

Re: New Format - Code tag options

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?
Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,375 posts
since Jan 2008
Sep 11th, 2009
0

Re: New Format - Code tag options

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?
Vernon,

You can get around that behavior. Take a look at this post:
http://www.daniweb.com/forums/post98...tml#post981568
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 12th, 2009
0

Re: New Format - Code tag options

Click to Expand / Collapse  Quote originally posted by sknake ...
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?
Featured Poster
Reputation Points: 2614
Solved Threads: 687
Posting Expert
VernonDozier is offline Offline
5,375 posts
since Jan 2008
Sep 12th, 2009
1

Re: New Format - Code tag options

You can do [code=text] to disable syntax highlighting completely:
text Syntax (Toggle Plain Text)
  1. ./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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in DaniWeb Community Feedback Forum Timeline: Nick Complete
Next Thread in DaniWeb Community Feedback Forum Timeline: Avatar size limits





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC