Re: Bug #11611 Updated: nl2br() outputting invalid <br> tags
| From: | Lenar Lõhmus | Date: | Sun, 24 Jun 2001 19:32:18 +0000 |
| Subject: | Re: Bug #11611 Updated: nl2br() outputting invalid <br> tags | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-57864@lists.php.net to get a copy of this message | ||
> > when the rest of your code is just generating HTML compliant output, not
> > XHTML.
> >
> > Ok, somebody can always use something like str_replace("\n",
> > "<br>",
> > $text) to get the old functionality.
>
> What if the rest of your code is generating XHTML? It's better to assume
> the more strict syntax, especially considering that nobody has yet found (to
> my knowledge) a browser where <br /> doesn't work.
>
Yes, agree, but this change has happend not much time ago, and I think
it's one's responsibility to maintain the behavior what it used to
be. Even more if the old syntax was generating standard compliant code
(and HTML4 is a standard).
Still, we must evolve, so a syntax like
nl2br(string text [boolean html4]) would give the most up to date
behaviour of this function, giving somebody an option to get the old
behaviour when it's really neccessary.
And ... you don't know a browser where <br /> dowsn't work? But there
might be one ... one's own specific implementation where creator haven't
thought up possibility that "<br>" might be "<br />" one day. Since
it is
not neccessary for HTML to recognize "/" in the end of single tag then we
can't really blame him.
lenar.
> Matt
>