I'm building an application
that takes the text of a page from a mysql database and replaces any
carriage returns with a <p> tag so it will appear correctly on the browser.
However, some of the pages have <blockquotes> and I do not want the carriage
returns within blockquote tags to be replaced with <p> tags -- rather, I
just want carriage returns within blockquote tags to be replaced with <br>
tags, like such:
<blockquote>
To be or not to be,<br>
that is the question,<br>
whether 'tis nobler...
</blockquote>
I am sure this can be accomplished with an elegant regular expression with some nested pattern matching, but can't come up with it.... Any help is appreciated.