473,808 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble using html tidy with template files

Hi!

First: sorry for my bad english :)

If I parse template files, html tidy remove all tags beginning with {
for example:

before:

<select name="country" size="1">
{section name=country loop=data}
<option>{$dat a[country]}</option>
{/section}
</select>

after:

<select name="country" size="1">
<option>{$dat a[country]}</option>
</select>

Only the "{$data[country]}" is untouched, because html tidy take it for
a value not for a tag.
How can I teach html tidy to ignore text starting with { and ending with }?

Thanks for your help!

S. Gohres
Mar 4 '06 #1
2 2039
Sebastian Gohres <cr******@arcor .de> wrote:
How can I teach html tidy to ignore text starting with { and ending with }?


Not possible.

If you want to use Tidy, run it on the output (X)HTML, not on the
template files.

--
Spartanicus
Mar 4 '06 #2
__/ [ Sebastian Gohres ] on Saturday 04 March 2006 18:12 \__
Hi!

First: sorry for my bad english :)

If I parse template files, html tidy remove all tags beginning with {
for example:

before:

<select name="country" size="1">
{section name=country loop=data}
<option>{$dat a[country]}</option>
{/section}
</select>

after:

<select name="country" size="1">
<option>{$dat a[country]}</option>
</select>

Only the "{$data[country]}" is untouched, because html tidy take it for
a value not for a tag.
How can I teach html tidy to ignore text starting with { and ending with }?

Thanks for your help!

S. Gohres


Your only possibility, I suspect, would be to get Tidy from SourceForge,
change the source code, and then recompile. You are not using Tidy to
sanitise true (X)HTML in this case and I can't believe an option exists for
one among the many possible exceptions.

What, for example, if you wanted to "tidy" some PHP scripts? That would
require a different tool altogether -- one which descends onto files and
executes an actual program, in PHP.

I suggest you consider before/after copies of the file being tidy'ied and
merge after the code has been sanitised. This is by no means easy if the
files are large. It becomes tedious.

Hope it helps,

Roy

--
Roy S. Schestowitz | Download Othello: http://othellomaster.com
http://Schestowitz.com | SuSE Linux | PGP-Key: 0x74572E8E
11:40am up 5 days 7:18, 9 users, load average: 0.12, 0.38, 0.50
http://iuron.com - next generation of search paradigms
Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3412
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only happening when I put my XML files and the .xsl files on my ISP's system for my home page. If I try to open the XML files in Netscape 7.0 on my own machine (ie, not on the ISP's system), the pages convert file and the result is displayed in HTML.
26
4073
by: Tobias Wendorff | last post by:
Hi there, could anybody please do me a big favour and compile the latest sourcecode of HTML Tidy (DLL and EXE)? http://tidy.sourceforge.net/src/tidy_src.tgz Visual C++ files are in "build\msvc" Actually, there is no website with win32 builds :-(
3
2780
by: Mike | last post by:
Greetings, I just used Tidy HTML for the first time. The address below contains the files need to check on Tidy's corrections. I would appreciate any feedback on the Tidy report and the necessity and validity of the changes Tidy has made or recommended. The following is obvious to me: line 194 column 98 - Warning: discarding unexpected </font>
14
16490
by: Khai | last post by:
I'm an extreme newbie, and have been nosing around the PHP.Net site for a few days. Only, the search function returns alot of information that's not truly relevant due to Coding samples at the bottom of the pages. What I'm trying to determine is : Which is better for printing info to a page based on dynamic variables? IE - if I have a boolean = True, should I use PrintF, print, echo to spit out the info?
4
6936
by: Tom Eldridge | last post by:
Hi all I'm getting tons of these errors when running the w3c validator on my template page. Basically it will say for example: element "TITLE" undefined. Do I need to put this into lowercase or uppercase or have I got completely the wrong end of the stick and need to define my doctype to another? Currently I have this:
40
5621
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html401/strict.dtd"> <html> <head>
26
25621
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any idea? Thanks you very much
3
6420
by: sebzzz | last post by:
Hi, I'm doing a little script with the help of the BeautifulSoup HTML parser and uTidyLib (HTML Tidy warper for python). Essentially what it does is fetch all the html files in a given directory (and it's subdirectories) clean the code with Tidy (removes deprecated tags, change the output to be xhtml) and than BeautifulSoup removes a couple of things that I don't want in the files (Because I'm stripping the files to bare bone, just...
0
569
by: Lars Eighner | last post by:
In our last episode, <004f629c$0$10265$c3e8da3@news.astraweb.com>, the lovely and talented mark4asp broadcast on comp.infosystems.www.authoring.html: I have not done this, not even on TV.
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.