Right, the process_thread_array function doesn't close tags, but it's an alternative approach. Done regexp to right trim off broken tags, easier than trying to close a random number of random tags, broken and all, but the thread preview approach might, might not, get you closer to what you want.