return;
}
- $this->utf8_strlen = create_function('$text', 'return preg_match_all(
- "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
- $text, $m);');
+ $this->utf8_strlen = function($text) {
+ return preg_match_all('/[\x00-\xBF]|[\xC0-\xFF][\x80-\xBF]*/', $text, $m);
+ };
}
/**
* copy the classes and readme file to lib/markdown/* , Note .inc files need not be copied.
* update function markdown_to_html() in weblib.php if necessary,
note that we require the php files manually for performance reasons
+* pull commits https://github.com/michelf/php-markdown/commit/0c1337a4d483b1e0b66bfdc3ffa644eafd40aa27
+ and https://github.com/michelf/php-markdown/commit/251ffcce7582d4b26936679e340abca973d55220
+ if they are not included in the next release (or remove this step)
* run phpunit tests
Petr Skoda
$result = "<p>some <a href=\"http://example.com/\">example link</a></p>\n";
$this->assertSame($result, markdown_to_html($text));
}
+
+ public function test_tabs() {
+ $text = "a\tbb\tccc\tя\tюэ\t水\tabcd\tabcde\tabcdef";
+ $result = "<p>a bb ccc я юэ 水 abcd abcde abcdef</p>\n";
+ $this->assertSame($result, markdown_to_html($text));
+ }
}