1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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

Discussion in 'Add-on Releases [Archive]' started by Jake Bunce, Sep 25, 2011.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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]
     

    Attached Files:

    PJK, Morgain, Fuhrmann and 7 others like this.
  2. Floris

    Floris Guest

    Code:
    win!
     
    Mikey likes this.
  3. giorgino

    giorgino Well-Known Member

    Hi Jake, what's the difference between rich and non-rich version of code bbcode? :confused:
     
  4. Andy.N

    Andy.N Well-Known Member

    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";
    }
     
    giorgino likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Rich allows you to use BB code inside of the code block. It is good for code highlighting.
     
  6. giorgino

    giorgino Well-Known Member

    Great thank you :)
     
  7. borbole

    borbole Well-Known Member

    Congratulations on your first add on release Jake :)
     
  8. Hillbilly

    Hillbilly Member

    Thank you, just what I was looking for! :)
     

Share This Page