org\parser\driver\Markdown::_detab_callback PHP Метод

_detab_callback() защищенный Метод

protected _detab_callback ( $matches )
    protected function _detab_callback($matches)
    {
        $line = $matches[0];
        $strlen = $this->utf8_strlen;
        # strlen function for UTF-8.
        # Split in blocks.
        $blocks = explode("\t", $line);
        # Add each blocks to the line.
        $line = $blocks[0];
        unset($blocks[0]);
        # Do not add first block twice.
        foreach ($blocks as $block) {
            # Calculate amount of space, insert spaces, insert block.
            $amount = $this->tab_width - $strlen($line, 'UTF-8') % $this->tab_width;
            $line .= str_repeat(" ", $amount) . $block;
        }
        return $line;
    }