Detab should be multi-byte aware?

Michel Fortin michel.fortin at michelf.com
Mon Oct 9 20:26:00 EDT 2006


Le 9 oct. 2006 à 19:43, Allan Odgaard a écrit :


> As you can see, expand is able to correctly convert tabs to spaces,

> where Markdown.pl counts the é as occupying two columns.


Ah! Now I see what you mean. It makes perfect sense and is super-easy
to reproduce. Thank you for that clear example.

If anyone is interested in a fix for PHP Markdown, just change the
call to the `strlen` function within detab to a call to `mb_strlen
($line, 'utf-8')`. I'll fix this for the next version.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/




More information about the Markdown-Discuss mailing list