Please support our DaniWeb Community Feedback advertiser: Programming Forums
![]() |
If I leave the language out of the code, then I can use colour just fine, like so
But if I add a language, say 'c', then it all goes pear shaped and the colour tags are no longer parsed.
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.
c Syntax (Toggle Plain Text)
printf("%d. file has been created[color="Red"]\r[/color]",i); fflush(stdout);
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,115
Reputation:
Rep Power: 33
Solved Threads: 117
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,115
Reputation:
Rep Power: 33
Solved Threads: 117
Bold and italic tags are already being used with the language-specific tags for specific keywords. For example, in the line 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.
c Syntax (Toggle Plain Text)
printf("%d. file has been created\r",i);
Last edited by cscgal : Nov 7th, 2007 at 2:27 pm.
Dani the Computer Science Gal
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
•
•
•
•
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.
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
-- Pearl Williams
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,115
Reputation:
Rep Power: 33
Solved Threads: 117
•
•
•
•
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
![]() |
Similar Threads
Other Threads in the DaniWeb Community Feedback Forum
- file handeling (C)
- Stuff has stopped working. (DaniWeb Community Feedback)
- Why color should be disabled ... (DaniWeb Community Feedback)
- code tags (DaniWeb Community Feedback)
- serial communication programming in C language (C)
- HTML & XML (HTML and CSS)
- [C][/C] Tags (DaniWeb Community Feedback)
- Checking source codes of image, audio and video files (Site Layout and Usability)
- Microsoft .NET FAQ (ASP.NET)
- Macromedia Coldfusion 5 Language Reference (ColdFusion)
Other Threads in the DaniWeb Community Feedback Forum
- Previous Thread: Moderator Positions
- Next Thread: Style Changes Today
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode