gajus / dindent

HTML indentation library for development and testing.
Other
180 stars 31 forks source link

Problème sometime with utf8 encoded string #15

Open eos-13 opened 9 years ago

eos-13 commented 9 years ago

Some utf8 encoded string don't work after being process. In indenter.php:

replace l75

        $input = preg_replace('/\s{2,}/', ' ', $input);

with

        $input = preg_replace('/\s{2,}/u', ' ', $input);

and (l158)

        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/', '\\1\\3', $output);

with

        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/u', '\\1\\3', $output);

Solve my problem ... Maybe should be commited ?

Best regards,

Fabbio86 commented 9 years ago

Great tool, but I have this annoying mistake as well. eos-13's solution solves my problem as well.