thephpleague / commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
https://commonmark.thephpleague.com
BSD 3-Clause "New" or "Revised" License
2.72k stars 191 forks source link

Loose the requirement of mbstring #38

Closed mnapoli closed 9 years ago

mnapoli commented 9 years ago

This library requires the mbstring extension. Unless I'm mistaken, this extension is not always installed on every system, and I'm afraid it will lead to problems with end users not being to install this project or projects requiring this one.

Why is that extension required? Simply for mb_* functions? In that case would it be acceptable to do something like "if mbstring then use mb_strlen else use strlen"?

philsturgeon commented 9 years ago

Patchwork UTF-8 might be a reasonable alternative but it depends how much of mb_string is actually used. You can get away with using core functions for a lot of stuff.

---Sent from Boxer | http://getboxer.com

On 25 December 2014 18:01:11 GMT-5, Matthieu Napoli notifications@github.com wrote:This library requires the mbstring extension. Unless I'm mistaken, this extension is not always installed on every system, and I'm afraid it will lead to problems with end users not being to install this project or projects requiring this one. Why is that extension required? Simply for mb_* functions? In that case would it be acceptable to do something like "if mbstring then use mb_strlen else use strlen "? —Reply to this email directly or view it on GitHub. =

cebe commented 9 years ago

Using the github search it looks like there are only 2 places, have not checked with IDE though.

philsturgeon commented 9 years ago

And this https://github.com/thephpleague/commonmark/blob/master/src/Util/Html5Entities.php#L2281

colinodell commented 9 years ago

This has been done :)

Thanks for the suggestion @mnapoli, and thanks @philsturgeon for getting the changes made!

mnapoli commented 9 years ago

Awesome thanks!