Hi Jonathon
I suggest one or more of the following three options:
1 running the markup through Tidy - http://au.php.net/tidy
(You'll have to compile PHP with Tidy - more at link above).
2 using an HTML4.0 transitional doctype for the pages that display 3rd
party markup.
3 use strip_tags to
hello all - thanks for all great suggestions
in the end, I went with a derivative of James' third idea below, and
did a little php/perl magic:
$plBody is the imported file:
$plBody = preg_replace(/br \//, ::ABBA::, $plBody);
#Convert all the br /'s to ::ABBA:: (a rather unlikly string)
Jonathan T. Sage wrote:
$plBody = preg_replace(/br \//, ::ABBA::, $plBody);
#Convert all the br /'s to ::ABBA:: (a rather unlikly string)
$plBody = preg_replace(/.+?/, , $plBody);
# Drop all other HTML tags
$plBody = preg_replace(/::ABBA::/, br /, $plBody);
#Convert all the ::ABBA::'s back to
Jonathan T. Sage wrote:
#Convert all the br /'s to ::ABBA:: (a rather unlikly string)
As I recall, ABBA the name of a popular band in the 70's
(http://www.abbasite.com/). Then again, there's also the American Bed
and Breakfast Association (http://www.abba.com/). Maybe you should use
_br;
You can't render a part of a page as HTML, but it is possible to let
PHP parse all pages with some variable or something like that as HTML
instead of XHTML.
On Sat, 27 Nov 2004 19:51:21 -0500, Jonathan T. Sage [EMAIL PROTECTED] wrote:
good evening -
I've set up my site to serve as XHTML
alright, dumb question anyway. My original expectation on all these
includes was that the incoming file was plaintext, with only br /
replacments on newlines. A little php magic and I just dumped the
rest of the markup. Thanks for the time
~j
On Sun, 28 Nov 2004 01:55:14 +0100, Rob Mientjes