User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the DaniWeb Community Feedback section within the Coffee House category of DaniWeb, a massive community of 397,610 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,556 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our DaniWeb Community Feedback advertiser:
Views: 1123 | Replies: 14
Reply
Join Date: Dec 2005
Posts: 3,338
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 20
Solved Threads: 378
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Language and colour tags

  #1  
Nov 7th, 2007
If I leave the language out of the code, then I can use colour just fine, like so
printf("%d. file has been created\r",i);
fflush(stdout);

But if I add a language, say 'c', then it all goes pear shaped and the colour tags are no longer parsed.
  1. printf("%d. file has been created[color="Red"]\r[/color]",i);
  2. fflush(stdout);
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Language and colour tags

  #2  
Nov 7th, 2007
That's the intended behaviour. When using language-specific tags, snippets are already color-coded. If you want to point out something specific, refer to it by line. If you absolutely have to point something out via color, use non language specific tags.
Reply With Quote  
Join Date: Aug 2005
Posts: 4,697
Reputation: iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice 
Rep Power: 17
Solved Threads: 307
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: Language and colour tags

  #3  
Nov 7th, 2007
Exactly.

I thought that was blatantly obvious.

I mean if you tagged something as red with c++ code tags it would hardly stand out amongst the other mix of colours.
Last edited by iamthwee : Nov 7th, 2007 at 12:45 pm.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Join Date: May 2006
Posts: 2,700
Reputation: WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold 
Rep Power: 14
Solved Threads: 219
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Maven

Re: Language and colour tags

  #4  
Nov 7th, 2007
One possibility to consider is to allow BOLD and ITALIC using language-specific tags. Just a thought.
Age is unimportant -- except in cheese
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Language and colour tags

  #5  
Nov 7th, 2007
Bold and italic tags are already being used with the language-specific tags for specific keywords. For example, in the line
  1. printf("%d. file has been created\r",i);
the word "printf" is actually in bold in contrast to the rest of the line. However, bold font is hard to distinguish in Courier New (or any fixed width font, for that matter). In fact, when I was very anti-color, and before we had syntax-specific code tags, the reason I conceded to allowing color was because people pointed out that bold and italic tags were not doing a good enough job pointing out specific lines in code.
Last edited by cscgal : Nov 7th, 2007 at 1:27 pm.
Reply With Quote  
Join Date: Apr 2006
Location: Canada
Posts: 4,458
Reputation: John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light 
Rep Power: 15
Solved Threads: 267
Moderator
Staff Writer
Featured Blogger
John A's Avatar
John A John A is offline Offline
Vampirical Moderator

Re: Language and colour tags

  #6  
Nov 8th, 2007
Wouldn't it be better if your parser at least removed the color tags from syntax-highlighted code? Some people aren't aware that color tags don't work in syntax-highlighted code tags (or they paste it from their editor, which for some reason has the code all colored), and then all we see is a bunch of BBCode crap.
tuxation.com - Linux articles, tutorials, and discussions
Reply With Quote  
Join Date: May 2006
Posts: 2,700
Reputation: WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold 
Rep Power: 14
Solved Threads: 219
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Maven

Re: Language and colour tags

  #7  
Nov 8th, 2007
Originally Posted by joeprogrammer View Post
Wouldn't it be better if your parser at least removed the color tags from syntax-highlighted code? Some people aren't aware that color tags don't work in syntax-highlighted code tags (or they paste it from their editor, which for some reason has the code all colored), and then all we see is a bunch of BBCode crap.

Nyah. If they want to screw up their code and post without a PREVIEW, let them. We just don't have to read it since they didn't care enough to verify their post.
Age is unimportant -- except in cheese
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Language and colour tags

  #8  
Nov 8th, 2007
What if someone wants to type code that uses the [param=value] format? If someone types [x=y] in their code it should be stripped?
Reply With Quote  
Join Date: Apr 2006
Location: Canada
Posts: 4,458
Reputation: John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light 
Rep Power: 15
Solved Threads: 267
Moderator
Staff Writer
Featured Blogger
John A's Avatar
John A John A is offline Offline
Vampirical Moderator

Re: Language and colour tags

  #9  
Nov 9th, 2007
Originally Posted by cscgal View Post
What if someone wants to type code that uses the [param=value] format? If someone types [x=y] in their code it should be stripped?

Well, you would only strip [color=xxx], [b], [i], etc. And considering that it would be parsed anyway if they had just used a normal [code] tag, what difference does it make?
tuxation.com - Linux articles, tutorials, and discussions
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Language and colour tags

  #10  
Nov 9th, 2007
Because this way people have a method for when they NEED to use such things in their code. If both code methods stripped them, they'd be SOL to display any code in bbcode format.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb DaniWeb Community Feedback Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the DaniWeb Community Feedback Forum

All times are GMT -4. The time now is 7:42 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC