Posted by Oli Filth on 05/16/05 20:33
Mig21 wrote:
> hi
>
> i am trying to make a bbcode parser and i get stuck at this :(
>
> i want to replace all '\n' with "<br />\n" in a text unless it's in
> between <pre></pre> tags. i can't figure out a way to conditionally
> replace anything.
>
If you're getting this problem, you're writing your parser back to
front. You need to split on the <pre> tags first, and then parse each
section separately.
--
Oli
Navigation:
[Reply to this message]
|