erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.69k stars 1.12k forks source link

Tabs throw error #780

Open hr-oss opened 3 years ago

hr-oss commented 3 years ago

If the parsedown input text contians a tab character ( ), then parsedown will throw the following error:

Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/html/assets/modules/parsedown/Parsedown.php:170 Stack trace: #0 /var/www/html/assets/modules/parsedown/Parsedown.php(39): Parsedown->lines() #1 /var/www/html/article.php(101): Parsedown->text() #2 {main} thrown in /var/www/html/assets/modules/parsedown/Parsedown.php on line 170

Workaround: str_replace(' ', ' ', parsedown_input);

sbrl commented 3 years ago

I haven't experienced this myself - at least as of 1610e4747c88a53676f94f752b447f4eff03c28d. Do you have an isolated test as an example?

hamedgasemi200 commented 3 years ago

Try installing mbstring module. It's not installed by default.

apt install php7.x-mbstring

https://www.php.net/manual/en/mbstring.installation.php