Click here to Skip to main content
15,886,873 members

Bugs and Suggestions

   

General discussions, site bug reports and suggestions about the site.

For general questions check out the CodeProject FAQs. To report spam and abuse Head to the Spam and abuse watch. If you wish to report a bug privately, especially those related to security, please email webmaster@codeproject.com

 
GeneralRe: Has the articles’ layout been modified? Pin
Chris Maunder1-Dec-23 3:54
cofounderChris Maunder1-Dec-23 3:54 
QuestionA question for 'Technical Blog' publishing Pin
0x01AA28-Oct-23 7:32
mve0x01AA28-Oct-23 7:32 
AnswerRe: A question for 'Technical Blog' publishing Pin
RedDk28-Oct-23 7:56
RedDk28-Oct-23 7:56 
GeneralRe: A question for 'Technical Blog' publishing Pin
0x01AA28-Oct-23 9:10
mve0x01AA28-Oct-23 9:10 
GeneralRe: A question for 'Technical Blog' publishing Pin
RedDk28-Oct-23 9:26
RedDk28-Oct-23 9:26 
AnswerRe: A question for 'Technical Blog' publishing Pin
Richard Deeming29-Oct-23 23:11
mveRichard Deeming29-Oct-23 23:11 
AnswerRe: A question for 'Technical Blog' publishing Pin
Sean Ewington30-Oct-23 5:18
staffSean Ewington30-Oct-23 5:18 
SuggestionCode block line numbers Pin
Richard Deeming27-Oct-23 4:42
mveRichard Deeming27-Oct-23 4:42 
It is currently possible to add line numbers to a code block by adding the linecount="on" attribute to the <pre> element.
  1  Line 1
  2  Line 2
  3  Line 3
These line numbers are inserted directly into the rendered HTML:
HTML
<span class="code-linenumber">  1  </span>Line 1
<span class="code-linenumber">  2  </span>Line 2
<span class="code-linenumber">  3  </span>Line 3
As a result, if you try to select part of the code block to copy, you end up including the line numbers:

The only option is to use the "copy" icon at the top of the script block to copy the entire block without line numbers, then use a text editor to trim it down to just the part you wanted to copy.

If instead you added the line numbers using the ::before pseudo-element[^], they would not be selectable. You would be able to select and copy any part of the code block without including the line numbers. And the "copy" script wouldn't need to strip the line numbers out.

You could even use CSS counters[^] to automatically generate the line numbers. Smile | :)

For example:
HTML
<pre data-linecount="True" style="--line-start:10;--line-increment:10;"><span class="code-linenumber"></span>Line 1
<span class="code-linenumber"></span>Line 2
<span class="code-linenumber"></span>Line 3
</pre>
CSS
pre[data-linecount="True"]{
    --line-initial: calc(var(--line-start, 1) - var(--line-increment, 1));
    counter-reset: line-number var(--line-initial, 0);
    
    /*
     Throw in some gratuitous CSS Nesting, now that it's widely supported:
     https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting/Using_CSS_nesting
    */
    & .code-linenumber::before {
        counter-increment: line-number var(--line-increment, 1);
        content: counter(line-number);
        display: inline-block;
        text-align: right;
        width: 2em;
        margin-right: .5em;
        opacity: 0.5;
    }
}
Demo[^]



The only potential issue would be determining an appropriate width for the line number element, so that it doesn't push short blocks over too far, but leaves enough room for the occasional massive wall-o-text code dump.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Code block line numbers Pin
Chris Maunder27-Oct-23 4:50
cofounderChris Maunder27-Oct-23 4:50 
BugMinor niggle: message column alignment issues Pin
Richard Deeming27-Oct-23 3:42
mveRichard Deeming27-Oct-23 3:42 
GeneralRe: Minor niggle: message column alignment issues Pin
Chris Maunder27-Oct-23 4:51
cofounderChris Maunder27-Oct-23 4:51 
QuestionUnable to download Sentiment Analysis zip file Pin
Member 1612386225-Oct-23 12:02
Member 1612386225-Oct-23 12:02 
AnswerRe: Unable to download Sentiment Analysis zip file Pin
Sean Ewington25-Oct-23 12:31
staffSean Ewington25-Oct-23 12:31 
GeneralRe: Unable to download Sentiment Analysis zip file Pin
Member 1612386225-Oct-23 13:19
Member 1612386225-Oct-23 13:19 
BugNo longer getting daily Newsletters Pin
User 425764723-Oct-23 21:11
professionalUser 425764723-Oct-23 21:11 
SuggestionNo Cyber Security, or Ethical Hacking Forum? Pin
Steve Raw24-Oct-23 15:23
professionalSteve Raw24-Oct-23 15:23 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
Nelek23-Oct-23 19:55
protectorNelek23-Oct-23 19:55 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
OriginalGriff24-Oct-23 5:35
mveOriginalGriff24-Oct-23 5:35 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
Nelek24-Oct-23 12:53
protectorNelek24-Oct-23 12:53 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
Steve Raw24-Oct-23 13:44
professionalSteve Raw24-Oct-23 13:44 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
Nelek25-Oct-23 8:48
protectorNelek25-Oct-23 8:48 
GeneralRe: No Cyber Security, or Ethical Hacking Forum? Pin
Steve Raw24-Oct-23 13:07
professionalSteve Raw24-Oct-23 13:07 
BugReply mistakenly flagged as spam Pin
Ravi Bhavnani21-Oct-23 15:53
professionalRavi Bhavnani21-Oct-23 15:53 
GeneralRe: Reply mistakenly flagged as spam Pin
Nelek22-Oct-23 6:44
protectorNelek22-Oct-23 6:44 
GeneralRe: Reply mistakenly flagged as spam Pin
Ravi Bhavnani22-Oct-23 14:15
professionalRavi Bhavnani22-Oct-23 14:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Flags: AnsweredUnder considerationAdded to TODO

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.