MyBB Community Forums

Full Version: whitespace tabs removed in MyBB editor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to figure out why MyBB is removing tabbed whitespace from the editor. And how can i make it retain that whitespace (Without the codebox)?

for example:
this indentation is spaces

class Klass:
    def __init__(self):
        pass 
    
    def test(self):
        while blah:
            if blah_blah:
                if blah_blah_blah:
                    pass 


and this is the same with the indentation replaced from spaces to tabs. It should appear the same, but it removes the tabs completely. 

class Klass:
def __init__(self):
pass 

def test(self):
while blah:
if blah_blah:
if blah_blah_blah:
pass


EDIT:
I tried adding a line in class_parser.php under parse_message() but it still replaces the tabs with nothing. 

        $message = str_replace("\t", '    ', $message);
So i notice if you take a snippet of text indented by tabs, and paste it into MYBB editor, for a fraction of a second it shows correctly, but then MyBB switched the tabs to nothing which results as all the indentation removed. I dont think now that it is class_parser as it does it immediately in the editor before posting and without preview. Would that be the javascript removing tabs?