You are here

function Markdown_Parser::_initDetab in Markdown 5

Same name and namespace in other branches
  1. 6 markdown.php \Markdown_Parser::_initDetab()
1 call to Markdown_Parser::_initDetab()
Markdown_Parser::Markdown_Parser in ./markdown.php

File

./markdown.php, line 1608

Class

Markdown_Parser

Code

function _initDetab() {

  #

  # Check for the availability of the function in the `utf8_strlen` property

  # (initially `mb_strlen`). If the function is not available, create a

  # function that will loosely count the number of UTF-8 characters with a

  # regular expression.

  #
  if (function_exists($this->utf8_strlen)) {
    return;
  }
  $this->utf8_strlen = create_function('$text', 'return preg_match_all(
			"/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
			$text, $m);');
}