[Pro] Coda 2, PHP & Web Toolkit, and Perch?

I just used the PHP & Web Toolkit Plugin in Coda 2 to Tidy Up my HTML code. Unfortunately, in doing so it stripped out all of my Perch CMS tags.

How can I prevent that from happening in the future?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can’t, not unless someone writes a flavor of Tidy that is Perch-aware. Tidy will ignore “normal” PHP interpolation, like this:

<p>This is HTML. <?php echo 'This is PHP.?></p>

or this:

<p>This is HTML. <?= 'This is PHP.?></p>

…because <? signals a Processing Instruction in SGML, which is the parent language of HTML and XML and nearly every other markup language going. Anything inside it is ignored by any interpreter except the one that recognizes it. Browsers naturally hide their contents for the most part, and so Tidy ignores them as well.

But Perch’s syntax is sort of an HTML Plus, and looks enough like HTML for Tidy to figure it’s just a typo on your part.

Walter

On May 16, 2013, at 2:59 AM, RavenManiac wrote:

I just used the PHP & Web Toolkit Plugin in Coda 2 to Tidy Up my HTML code. Unfortunately, in doing so it stripped out all of my Perch CMS tags.

How can I prevent that from happening in the future?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, I just got a response from Chipwreck, the company that makes PHP & Web Toolkit. Here is their response, although I haven’t tried it yet. I’m posting it here because I thought it might be helpful to others.

Question for Chipwreck:

How do I prevent Tidy HTML from stripping out CMS specific tags, such as:

<perch:label …
<perch:input …
<perch:error …

Chipwrecks Response:

Select “custom…” as configuration for tidy and add the tags after “new-blocklevel-tags” or “new-inline-tags” – that shall do the trick.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options