[ciapug] Re: RE: Dynamically formatted HTML Source
Carl Olsen
carl-olsen at mchsi.com
Fri Sep 8 15:33:42 CDT 2006
I don't know for sure, but I'm guessing HEREDOC would do the trick if you
were just trying to paste a large block of HTML. I would guess it would be
similar with a WYSIWYG text editor. I've noticed that TinyMCE removes all
my line breaks and tabs when I use the one that comes with Joomla. Not sure
what's up with that. I can paste it into Dreamweaver and it will add all of
the line breaks and tabs back into it when I use the format tool. It's kind
of annoying.
Thank you!
Carl
-----Original Message-----
From: ciapug-bounces at cialug.org [mailto:ciapug-bounces at cialug.org] On Behalf
Of Mike Parks
Sent: Friday, September 08, 2006 2:06 PM
To: ciapug at cialug.org
Subject: [ciapug] Re: RE: Dynamically formatted HTML Source
Carl,
Is this code you have predefined or is it code coming from a WYSIWYG
textarea like FCKEditor?
If it is predefined by you?
I have in my code been using /n's for new line and /t's as many as
needed to tab the line. Or I have used HEREDOC syntax
$var = <<<BOF
Some code
BOF;
print $var;
HEREDOC formats the code fairly well.
If it is from the WYSIWYG textarea The best I have been able to get
is a new line.
Mike
At 12:00 PM 9/8/2006, you wrote:
>Send ciapug mailing list submissions to
> ciapug at cialug.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://cialug.org/mailman/listinfo/ciapug
>or, via email, send a message with subject or body 'help' to
> ciapug-request at cialug.org
>
>You can reach the person managing the list at
> ciapug-owner at cialug.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of ciapug digest..."
>
>
>Today's Topics:
>
> 1. Dynamically formatted HTML Source (James Loghry)
> 2. Re: Dynamically formatted HTML Source (Tony Bibbs)
> 3. RE: Dynamically formatted HTML Source (Carl Olsen)
> 4. RE: Dynamically formatted HTML Source (Carl Olsen)
> 5. Re: Dynamically formatted HTML Source (James Loghry)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Thu, 07 Sep 2006 15:23:32 -0500
>From: James Loghry <loghry at krellinst.org>
>Subject: [ciapug] Dynamically formatted HTML Source
>To: ciapug at cialug.org
>Message-ID: <45007FC4.5060606 at krellinst.org>
>Content-Type: text/plain; charset=ISO-8859-1
>
>I'm constantly dealing with dynamic web sites using PHP here at work.
>It's a pain to keep track of all the newlines and tabs and whatnot when
>displaying HTML through php. This is especially true when there are
>several included files.
>
>Is there a nice and easy trick to have PHP nicely format the HTML source
>before the client browser sees it? Perhaps in XHTML format or such?
>(By format I mean the spacing and tabs of elements)
>
>--
>James Loghry
>Software Engineer
>The Krell Institute
>1609 Golden Aspen Dr., Suite 101
>Ames, IA 50010
>http://www.krellinst.org
>Phone: (515) 956 - 3696
>Email: loghry at krellinst.org
>
>
>
>------------------------------
>
>Message: 2
>Date: Thu, 07 Sep 2006 15:32:08 -0500
>From: Tony Bibbs <tony at tonybibbs.com>
>Subject: Re: [ciapug] Dynamically formatted HTML Source
>To: loghry at krellinst.org, ciapug at cialug.org
>Message-ID: <450081C8.7050806 at tonybibbs.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>Here you go:
>
>http://www.w3.org/People/Raggett/tidy/
>
>Search for indenting.
>
>--Tony
>
>James Loghry wrote:
> > I'm constantly dealing with dynamic web sites using PHP here at work.
> > It's a pain to keep track of all the newlines and tabs and whatnot when
> > displaying HTML through php. This is especially true when there are
> > several included files.
> >
> > Is there a nice and easy trick to have PHP nicely format the HTML source
> > before the client browser sees it? Perhaps in XHTML format or such?
> > (By format I mean the spacing and tabs of elements)
> >
>
>
>------------------------------
>
>Message: 3
>Date: Thu, 7 Sep 2006 16:31:08 -0500
>From: "Carl Olsen" <carl-olsen at mchsi.com>
>Subject: RE: [ciapug] Dynamically formatted HTML Source
>To: <loghry at krellinst.org>, <ciapug at cialug.org>
>Message-ID: <006901c6d2c4$eebe26e0$1c00a8c0 at workstation8>
>Content-Type: text/plain; charset="us-ascii"
>
>\r is a return
>\n is a new line
>\t is a tab
>
>
>-----Original Message-----
>From: ciapug-bounces at cialug.org [mailto:ciapug-bounces at cialug.org] On
Behalf
>Of James Loghry
>Sent: Thursday, September 07, 2006 3:24 PM
>To: ciapug at cialug.org
>Subject: [ciapug] Dynamically formatted HTML Source
>
>I'm constantly dealing with dynamic web sites using PHP here at work.
>It's a pain to keep track of all the newlines and tabs and whatnot when
>displaying HTML through php. This is especially true when there are
>several included files.
>
>Is there a nice and easy trick to have PHP nicely format the HTML source
>before the client browser sees it? Perhaps in XHTML format or such?
>(By format I mean the spacing and tabs of elements)
>
>--
>James Loghry
>Software Engineer
>The Krell Institute
>1609 Golden Aspen Dr., Suite 101
>Ames, IA 50010
>http://www.krellinst.org
>Phone: (515) 956 - 3696
>Email: loghry at krellinst.org
>
>_______________________________________________
>ciapug mailing list
>ciapug at cialug.org
>http://cialug.org/mailman/listinfo/ciapug
>
>
>
>------------------------------
>
>Message: 4
>Date: Thu, 7 Sep 2006 16:36:30 -0500
>From: "Carl Olsen" <carl-olsen at mchsi.com>
>Subject: RE: [ciapug] Dynamically formatted HTML Source
>To: <ciapug at cialug.org>, <loghry at krellinst.org>
>Message-ID: <006a01c6d2c5$af0ad1f0$1c00a8c0 at workstation8>
>Content-Type: text/plain; charset="us-ascii"
>
>Maybe I didn't understand the question. When I'm using PHP to output some
>HTML, it doesn't produce any line breaks or indentation in the HTML source
>view. I add them manually so that it looks like it was created with an
HTML
>editor.
>
>Carl
>http://www.ciapug.net/
>
>
>
>-----Original Message-----
>From: ciapug-bounces at cialug.org [mailto:ciapug-bounces at cialug.org] On
Behalf
>Of Tony Bibbs
>Sent: Thursday, September 07, 2006 3:32 PM
>To: loghry at krellinst.org; ciapug at cialug.org
>Subject: Re: [ciapug] Dynamically formatted HTML Source
>
>Here you go:
>
>http://www.w3.org/People/Raggett/tidy/
>
>Search for indenting.
>
>--Tony
>
>James Loghry wrote:
> > I'm constantly dealing with dynamic web sites using PHP here at work.
> > It's a pain to keep track of all the newlines and tabs and whatnot when
> > displaying HTML through php. This is especially true when there are
> > several included files.
> >
> > Is there a nice and easy trick to have PHP nicely format the HTML source
> > before the client browser sees it? Perhaps in XHTML format or such?
> > (By format I mean the spacing and tabs of elements)
> >
>_______________________________________________
>ciapug mailing list
>ciapug at cialug.org
>http://cialug.org/mailman/listinfo/ciapug
>
>
>
>------------------------------
>
>Message: 5
>Date: Thu, 07 Sep 2006 16:50:36 -0500
>From: James Loghry <loghry at krellinst.org>
>Subject: Re: [ciapug] Dynamically formatted HTML Source
>To: ciapug at cialug.org
>Message-ID: <4500942C.1090603 at krellinst.org>
>Content-Type: text/plain; charset=ISO-8859-1
>
>Carl, Thats what I have been doing as well, and I am trying to remedy
>that ;) .
>Tidy actually has a plugin for PHP. However, when I try to install tidy
>on my webserver, it complains about not being able to find php-config
>(even when I specify php-config as an argument..
>
>Anyways I may have found an easier route along the lines of appending
>the HTML to a DOM structure and then outputting the HTML:
>
>$out = ob_get_contents();
>$dom = new DomDocument();
>$dom->loadHTML($out);
>echo $dom->saveHTML();
>
>I have yet to try this and see if it works, however.
>
>Carl Olsen wrote:
>
> > > Maybe I didn't understand the question. When I'm using PHP to
> output some
> > > HTML, it doesn't produce any line breaks or indentation in the
> HTML source
> > > view. I add them manually so that it looks like it was created
> with an HTML
> > > editor.
> > >
> > > Carl
> > > http://www.ciapug.net/
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: ciapug-bounces at cialug.org
> [mailto:ciapug-bounces at cialug.org] On Behalf
> > > Of Tony Bibbs
> > > Sent: Thursday, September 07, 2006 3:32 PM
> > > To: loghry at krellinst.org; ciapug at cialug.org
> > > Subject: Re: [ciapug] Dynamically formatted HTML Source
> > >
> > > Here you go:
> > >
> > > http://www.w3.org/People/Raggett/tidy/
> > >
> > > Search for indenting.
> > >
> > > --Tony
> > >
> > > James Loghry wrote:
> > >
> >
> >> >> I'm constantly dealing with dynamic web sites using PHP here at
work.
> >> >> It's a pain to keep track of all the newlines and tabs and whatnot
when
> >> >> displaying HTML through php. This is especially true when there are
> >> >> several included files.
> >> >>
> >> >> Is there a nice and easy trick to have PHP nicely format the
> HTML source
> >> >> before the client browser sees it? Perhaps in XHTML format or such?
> >> >> (By format I mean the spacing and tabs of elements)
> >> >>
> >> >>
> >>
> > > _______________________________________________
> > > ciapug mailing list
> > > ciapug at cialug.org
> > > http://cialug.org/mailman/listinfo/ciapug
> > >
> >
>
>
>-- James Loghry Software Engineer The Krell Institute 1609 Golden Aspen
>Dr., Suite 101 Ames, IA 50010 http://www.krellinst.org Phone: (515) 956
>- 3696 Email: loghry at krellinst.org
>
>
>
>------------------------------
>
>_______________________________________________
>ciapug mailing list
>ciapug at cialug.org
>http://cialug.org/mailman/listinfo/ciapug
>
>
>End of ciapug Digest, Vol 17, Issue 1
>*************************************
<><><><><><><><><><><><><><><>
Mike Parks
Captain Jack Communications
Email: mparks at captainjack.com
Technical Email: techsupport at captainjack.com
Phone: 515-964-8500
Toll-Free: 800-581-3230
_______________________________________________
ciapug mailing list
ciapug at cialug.org
http://cialug.org/mailman/listinfo/ciapug
More information about the ciapug
mailing list