How can I "Insert Code" in a Forum Post?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I "Insert Code" in a Forum Post?

Jump to solution
4,213 Views
TomE
Specialist II

The old forum had a simple "Insert Code" which would allow source code to be inserted in a Monospace font and without it being reformatted.

This was also useful for inserting simple lists and tables.

Is there an equivalent in the new forums?

Does the "Insert Syntax Highlighting" do this? Apparently not. I have no idea what's happening here, it seems to have tried to make a table...

    do {
        p_msg = &msgs[i];

        len = this->len - this->xfer;
        if (len >
            len = 8;
        data_cmd = this->xfer / 8 & 0x07;

I've searched the whole of this forum for "syntax" and there doesn't seem to be anything that says what "Syntax Highlighting" is or how to use it.

Tom


0 Kudos
Reply
1 Solution
3,535 Views
-nilda
Contributor IV

I am feeling your pain now :smileysad:.  This seems to be a bug with the software (collaboration platform).  We will be placing a ticket with the support team for further review of this issue.  Thank you for bringing this to our attention.

View solution in original post

0 Kudos
Reply
3 Replies
3,535 Views
-nilda
Contributor IV

Select the block of text you want to format, then click the >> button and select the formatting style you want or click the >> button and select the formatting style you want, then type your code in the shaded box.

syntax.jpg

If this is not working correctly for you, please let us know so we can further investigate the issue with the support team for this platform.

3,535 Views
TomE
Specialist II

> Select the block of text you want to format, then click the >> button

Thanks for the quick response.

That's what I tried to do in my original post, and it didn't work so I gave up. I'll try it again:

There's no ">>" visible in this Reply Form. I'm pretty sure the previous forum showed "Insert Code" in all reply forms. So I have to click on "Advanced Edit" in order to use this feature in a reply.

Pasting in the code, then selecting, then ">> Syntax Highlighting C++":

#include <stdio.h>

int main(int argc, char **argv)

{

    printf("Hello \n");

    return (0);

}

That, worked, but messed up the formatting on the "Select" (adding extra lines) that I then had to delete later.

Now to try it the other way, selecting >> Syntax Highlighting C++" and then pasting in:

#include <stdio.h>

int main(int argc, char **argv)

{

    printf("Hello \n");

    return (0);

}

That didn't work. It pasted in BEFORE the highlighted block. Try again.

#include <stdio.h>

int main(int argc, char **argv)

{

    printf("Hello \n");

    return (0);

}

That didn't work again. Try again...


Now the following sort-of worked. but you can't see what it did to me. I selected the "Syntax Highlighting", then typed a blank line into the formatted area to try and get around the bug where it pastes in BEFORE the line, and then pasted. The code ended up formatted properly, but the whole block didn't stay put, but jumped up two or more lines in my post and ended up BEFORE the line where I typed "Try again".

#include <stdio.h>

int main(int argc, char **argv)

{

    printf("Hello \n");

    return (0);

}

I'm using Firefox 14.0.1 if that's any help.

Could you please TEST this feature multiple ways, see if you can reproduce the failings and then see if you can fix them. And document them.

This is unstable, not very obvious, takes a long time to get right and isn't documented anywhere I can find.

.

There is no help for this anywhere in the system. It may be mentioned in one of the "tutorial videos" that are provided, but I don't have the bandwidth or time to use them. I expect to be able to "Search Help" for keywords or phrases, but you can't perform a text-based search on a video.

Would it be possible to optionally "skin" this forum so it works the same way the old one did?

Tom

0 Kudos
Reply
3,536 Views
-nilda
Contributor IV

I am feeling your pain now :smileysad:.  This seems to be a bug with the software (collaboration platform).  We will be placing a ticket with the support team for further review of this issue.  Thank you for bringing this to our attention.

0 Kudos
Reply