Topic on Project:Support desk

How to display code text to provide appropriate color

3
12.132.46.25 (talkcontribs)

Greetings,

I have found various ways to surround code but I haven't found a way that will accomodate various colors. For instance, the code below should be displayed as one block like this:


enum tagImageReductionLevel
{
    reduceNone   = 0x0000, // (0) do not reduce any images   
    reduceSmall  = 0x0001, // (1) small   
    reduceMedium = 0x0002, // (2) medium   
    reduceLarge  = 0x0003, // (3) large} ImageReductionLevel;
}ImageReductionLevel;

However, using the tags above did not allow the author's intentions for color to be displayed.

In the example below, the colors are displayed as they should be, but the block of code has been divided at the top and bottom:

enum tagImageReductionLevel {

  reduceNone   = 0x0000, // (0) do not reduce any images
  reduceSmall  = 0x0001, // (1) small
  reduceMedium = 0x0002, // (2) medium
  reduceLarge  = 0x0003, // (3) large

} ImageReductionLevel;

Is there a method that keeps the code together and provides the intended color also?

Thanks!

Hamilton Abreu (talkcontribs)

Yes, leave at least one space at the start of every line:

enum tagImageReductionLevel
{
  reduceNone   = 0x0000, // (0) do not reduce any images
  reduceSmall  = 0x0001, // (1) small
  reduceMedium = 0x0002, // (2) medium
  reduceLarge  = 0x0003, // (3) large
} ImageReductionLevel;
Emufarmers (talkcontribs)
Reply to "How to display code text to provide appropriate color"