When using the <pre> tag in an HTML element, the result looks okay in the WYSIWYG editor but the line breaks are stripped out in the browser. An odd indent is also added at the front.
If you add an HTML element to any block and paste in this text, you can observe the difference:
<pre>
<code>
public class MyClass {
public int myVariable;
void Start() {
if( myVariable > 0 ) DoAThing( myVariable );
}
public void DoAThing( int input ) {
// etc.
}
}
</code>
</pre>
When using the <pre> tag in an HTML element, the result looks okay in the WYSIWYG editor but the line breaks are stripped out in the browser. An odd indent is also added at the front.
If you add an HTML element to any block and paste in this text, you can observe the difference:
<pre>
<code>
public class MyClass {
public int myVariable;
void Start() {
if( myVariable > 0 ) DoAThing( myVariable );
}
public void DoAThing( int input ) {
// etc.
}
}
</code>
</pre>
Last edited 26 December 2020 by drewc