function Markdown_Parser::_detab_callback in Markdown 5
Same name and namespace in other branches
- 6 markdown.php \Markdown_Parser::_detab_callback()
File
- ./markdown.php, line 1591
Class
- Markdown_Parser
Code
function _detab_callback($matches) {
$line = $matches[0];
$strlen = $this->utf8_strlen;
$blocks = explode("\t", $line);
$line = $blocks[0];
unset($blocks[0]);
foreach ($blocks as $block) {
$amount = $this->tab_width - $strlen($line, 'UTF-8') % $this->tab_width;
$line .= str_repeat(" ", $amount) . $block;
}
return $line;
}