15
I ran into this same problem. I used NSections and needed to somehow bypass textsanitizer in some way from replacing my line breaks into <br \> tags. What I did was include a new field in the database called "ignoreCR" (ignore carriage returns). This is either 0 or 1. The article view function detects this value. If it's 1 then you want to bypass the line break replace. What I do is include this line:
$content = preg_replace("/(\015\012)|(\015)|(\012)/","",$content);
to replace all line breaks. Now everytime you view your article it will replace all your line breaks so that none exist. Your content will be a glob of code with no line breaks. Therefore textsanitizer can't insert any line breaks when it runs. It also only does this on view, so your code in the database still looks line break formatted. You'll also need to add <p \>, <p>, <br>, and <br \>, depending on which you use for line breaking, to your allowable html. The ones with the '\>' closing are to keep the xhtml 1.0 standard. You may even want to add all these to your allowable html tags. I thought this might cause from problems with other content, but it hasn't and I don't see how a user can misuse these tags to screw up your site. The file to edit this is in class/xoopslists.php.
Now whenever I want to import content that is html preformatted I just paste it in, set ignoreCR to 1 and it'll skip all line break replacements. I also had to add this to the admin forms, but it didn't take much work. Works like a charm for me so far.