Unfortunately the only way to do line numbers is either to already have them in your code and put the <pre> block around it, or to add the line numbers manually. As for colorizing the code, you certainly can. There are a couple of ways to do it, one is to add the language tag in the code, the other is the use the dropdown to add it: CodeProject Article FAQ - Part 2: How to Post an Article on CodeProject [^]
Some articles have CPOL mentioned on top and bottom description.
But individual files in the source code have different license texts.
// Written by Chris Maunder (firstname.lastname@example.org)4// Copyright 1998-2005.5//6// TextProgressCtrl is a drop-in replacement for the standard7// CProgressCtrl that displays text in a progress control.8//9// Homepage: http://www.codeproject.com/miscctrl/text_progressctrl.asp10//11// This code may be used in compiled form in any way you desire. This12// file may be redistributed by any means PROVIDING it is not sold for13// profit without the author's written consent, and providing that this14// notice and the author's name is included. If the source code in15// this file is used in any commercial application then an email to16// me would be nice.17//18// This file is provided "as is" with no expressed or implied warranty.19// The author accepts no liability if it causes any damage to your20// computer or anything else vaguely within its vicinity.21//22// Expect bugs.23//24// Please use and enjoy. Please let me know of any bugs/mods/improvements25// that you have found/implemented and I will fix/incorporate them into this26// file.
My question iswhen an author posts his code on Code Project, does his license override CPOL or the license statement in the individual file stands for the particular file and CPOL isfor the files with no explicit license?
Does anybody know a way to get truthful live-previews?
So far nothing works for me, it always lies, so that whenever I click "Add A Solution".
I then discover that my posted text was modded from what's displayed in the live-preview.
Tried several 'pre' codes, its easy to get the preview looking correct, but it wont post that way.
If not, I'm ok without previews if there's anything I can do to keep the posted text from being auto-modded (it will usually be PCRE regular expression).
I use the pre tags extensively in Solutions and it always gets posted correctly. I notice that you have only posted one Solution, and it does not have any formatted part. So are there any actual examples of the problem you describe?
And by the way, this has nothing to do with Article writing.
Many thanks for replying.
Yes, I tried many times answering... https://www.codeproject.com/Questions/727990/REGEX-for-validating-URL
I tried at least 8 different times. The preview displayed perfectly, until I actually clicked the 'Post your solution'.
After that, the text was auto-modded, this happenned irregardless of how many pre tags I experimented with.
Im not sure what finally made the difference, I did change the default paste options.
And then I just used the standard pre tag (not ASM,ASP,etc), and it posted just like the preview.
Again, many thanks for the reply!