• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Force rich CODE tag

Jake Bunce

XenForo moderator
Staff member
#1
This is a very simple addon that overrides the CODE tag so it is always rich. With this addon installed these two code blocks will do the same thing:


[code=rich]

[/code]


[code]

[/code]


It will always be rich even if you don't specify 'rich'.

Note that even with this addon installed you can still force a plain code block by using the PLAIN tag inside of the code block:


[plain]

[/plain]
 

Attachments

Andy.N

Well-known member
#4
Here is what it looks with rich code
Code:
// Hello.cpp
//
// Simple example of function bodies.
//

// Preprocessor for include files
#include <stdio.h> // C style I/O
#include <iostream> // C++ style I/O using operator overloading
using namespace std; // The C++ logical collection of functions

void hello_C()
{
printf("Hello Quantnet, C style\n");
}

void hello_CPP()
{
// Using (binary) operator overloading
cout << "Hello Quantnet, C++ style \n";
}
and with regular code
Code:
// Hello.cpp
//
// Simple example of function bodies.
//

// Preprocessor for include files
#include <stdio.h> // C style I/O
#include <iostream> // C++ style I/O using operator overloading
using namespace std; // The C++ logical collection of functions

void hello_C()
{
printf("Hello Quantnet, C style\n");
}

void hello_CPP()
{
// Using (binary) operator overloading
cout << "Hello Quantnet, C++ style \n";
}