protected function before_parsing() {
        $this->toc = array();

        $this->string = preg_replace('/\r\n/', "\n", $this->string);
        $this->string = preg_replace('/\r/', "\n", $this->string);

        $this->string .= "\n\n";

        if (!$this->printable && $this->section_editing) {
            $this->returnvalues['unparsed_text'] = $this->string;
            $this->string = $this->get_repeated_sections($this->string);
        }
    }