I was reading http://github.github.com/github-flavored-markdown/
I would like to implement that \"Newline modification\" in PHP Markdown:
Best I could think of
PHP's nl2br -function doesn't cut it?
nl2br — Inserts HTML line breaks before all newlines in a string
http://php.net/manual/en/function.nl2br.php
If you also want to remove all linebreaks (nl2br inserts
), you could do:
str_replace('\n', '', nl2br($my_html));
If not, please elaborate on how your solution fails, and what you'd like to fix.