cancel
Showing results for 
Search instead for 
Did you mean: 

Can't add formatted code to forum message

Former Member
0 Kudos

The new message editor is nice, except for the fact that it destroys formatting of code blocks! In the old editor, we could use the

 .... 

tags to maintain formatting, but the new editor has no such tag. Also, the HTML tag <pre> ... </pre> is not supported.

Since a lot of messages are code-related, and users include blocks of code in questions or replies, it would be a good idea to return the notion of pre-formatted blocks of text, so that the following example is averted:

<u>Example</u>

<b>

function myFunction(int x)

{

if(x < 2)

{

println("x < 2");

}

else if(x > 2 && x < 4)

{

println("x is between 2 and 4");

}

else

{

println("x > 4");

}

}

</b>

Horrible!

Walter

Accepted Solutions (1)

Accepted Solutions (1)

michael_goeck
Active Participant
0 Kudos

Hi Walter,

please read this post [here|;. The old Java code filter is buggy and caused trouble due to infinite loops. Therefore we had to shut it down.

Anyway, as you can read in my first post, a new markup should be used: Just put two &#123;code&#125; around your code, and it will look like this:


System.out.println("Hallo");

Regards,

Michael

Answers (1)

Answers (1)

Former Member
0 Kudos

OK - found my own answer in a blog.... have to use the "code" tag - put your code in between two tags code in curly brackets <b>{</b>code<b>}</b>. Why isn't this documented to the right of the message editor?


function myFunc(int x)
{
    print("x = " + x);
}

michael_goeck
Active Participant
0 Kudos

Indeed some markup possibilities are not listed in the editor legend. This will be fixed with our January release.

Regards,

Michael