473,789 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tidy & inline style

I recently discovered the value of tidy for my html adventures. Nice
little app. Only one thing is becoming a bit of a drag.

If I use tidy to clean up my code, it inserts the following in every
<style> segment:

e.g. before:

<style>
p {
color : blue;
}
</style>
after: (tidy -im myfile.html)

<style>
/*<![CDATA[*/
p {
color : blue;
}

/*]]>*/
</style>

I'm assuming (correctly?) these are supposed to be html comment markers
to hide the style from style-unaware browsers ?
Is it possible (how) to have tidy insert the proper <!-- and -->
instead? And without the /* and */, or should they be there ??? And
should the html comment markers not sit outside the <style> element?

I'm confused right now...

Sorry for asking a question with a probably obvious answer.
KR
Sh.
Apr 2 '06 #1
4 2836
em
The CDATA part is an XML construct to handle text strings that does not
need to follow the same rules as everything else. They are there so
that an XML parser can see that it's dealing with content that it
should just skip past. Without using Tidy I can guess that it's adding
the CDATA part to XHTML documents just to make sure they can be parsed
with an XML parser as intended. Hope that helped you somewhat.

--
Emil Stenström
http://friendlybit.com

Schraalhans Keukenmeester wrote:
I recently discovered the value of tidy for my html adventures. Nice
little app. Only one thing is becoming a bit of a drag.

If I use tidy to clean up my code, it inserts the following in every
<style> segment:

e.g. before:

<style>
p {
color : blue;
}
</style>
after: (tidy -im myfile.html)

<style>
/*<![CDATA[*/
p {
color : blue;
}

/*]]>*/
</style>

I'm assuming (correctly?) these are supposed to be html comment markers
to hide the style from style-unaware browsers ?
Is it possible (how) to have tidy insert the proper <!-- and -->
instead? And without the /* and */, or should they be there ??? And
should the html comment markers not sit outside the <style> element?

I'm confused right now...

Sorry for asking a question with a probably obvious answer.
KR
Sh.


Apr 2 '06 #2
em@kth.se wrote:
The CDATA part is an XML construct to handle text strings that does not
need to follow the same rules as everything else. They are there so
that an XML parser can see that it's dealing with content that it
should just skip past. Without using Tidy I can guess that it's adding
the CDATA part to XHTML documents just to make sure they can be parsed
with an XML parser as intended. Hope that helped you somewhat.

--
Emil Stenström
http://friendlybit.com

Thanks for clearing that mystery up. Also explains why I found multiple
docs on the web containing the same construction. And save me from
removing that bit each and every time. :-)

KR
Sh.

PS. Most people -including myself- would rather see you reply below
original postings. Please be so kind and set your newsproggy
accordingly. Most offer you a choice between top or bottom reply.
Apr 2 '06 #3
Schraalhans Keukenmeester wrote :
I recently discovered the value of tidy for my html adventures. Nice
little app. Only one thing is becoming a bit of a drag.

If I use tidy to clean up my code, it inserts the following in every
<style> segment:

e.g. before:

<style>
p {
color : blue;
}
</style>

This is called embedded stylesheet or local stylesheet; not inline style.

after: (tidy -im myfile.html)

<style>
/*<![CDATA[*/
p {
color : blue;
}

/*]]>*/
</style>

I'm assuming (correctly?) these are supposed to be html comment markers
to hide the style from style-unaware browsers ?
Actually, they are not. They are used (sole purpose) to escape
occurences of "<", ">" and "&" in XHTML documents.
This section explains:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.8

Is it possible (how) to have tidy insert the proper <!-- and -->
instead?

Non-capable CSS browsers which fail to ignore <style> blocks are no
longer in use. So,
<!-- ... -->
inside <style> blocks are no longer necessary and should be dropped.

So, those comment delimiters are no longer serving any useful purpose
inside <style> blocks.
And without the /* and */, or should they be there ??? And
should the html comment markers not sit outside the <style> element?


Ideally, Tidy should have spotted
<style>
and recommend to the user to use
<style type="text/css">

Gérard
--
remove blah to email me
Apr 3 '06 #4
> PS. Most people -including myself- would rather see you reply below
original postings. Please be so kind and set your newsproggy
accordingly. Most offer you a choice between top or bottom reply.


I'm acctually using Google Groups :) I'll think of that in the future.

--
Emil Stenström
http://friendlybit.com

Apr 4 '06 #5

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

Similar topics

3
8266
by: Victor Irzak | last post by:
Hello, I have an ABC. it supports: ostream & operator << I also have a derived class that supports this operator. How can I call operator << of the base class for derived object??? Is it at all possible?
0
3006
by: Anne van Kesteren | last post by:
Ok, here it goes. Originally I submitted this proposal to www-style. Since I don't get feedback there, I think I missed a few (maybe a lot) of points. Proposal: <http://lists.w3.org/Archives/Public/www-style/2003Nov/0096.html> (for some strange reason I can't post to that list myself) The first point I missed was of course that CSS3UI is not planning to do anything with FIELDSET and LEGEND
4
10251
by: Shash | last post by:
Hey People, I'm facing a issue with browser compatablity here, I want a certain group of divs to behave like a table row, i.e if one of the cell/div has content longer than the other divs, all the other divs should reflect the same height. I managed to get success in doing this with mozilla (i love it!) and Opera 7, but IE seems to be ignoring the defined function (again!) of the properties display: table, table-row, table-cell...
2
2360
by: Mikaël Hautin | last post by:
Hi there, I'm Mikaël Hautin, a new one to this newsgroup. I will show you how to get rid of <a> tags to put links on pictures. When you want to put a link to another page on a picture, you type this kind of HTML code : <a href="page.html" style="text-decoration:none;" alt="funny things ....">
27
3861
by: Daniel Vallstrom | last post by:
I'm having problems with inconsistent floating point behavior resulting in e.g. assert( x > 0.0 && putchar('\n') && x == 0.0 ); holding. (Actually, my problem is the dual one where I get failed assertions for assertions that at first thought ought to hold, but that's not important.) At the end is a full program containing the above seemingly
0
2652
by: mahaq | last post by:
Hi Guys, I like to know if there is any better solution to this issue. I am a front end developer using CSS and asp.net technologies I have a .net page and I am using an external CSS file. After adding the following code What I see is that its fine on IE 6 & 7 but on firefox and netscape the 2 links given below shift to the center.
13
2805
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is produced like: <title>my very long title blab la blab la Blabla bla </title> Importer also has got problems with it
3
3325
by: KimberlyM | last post by:
This has been driving me crazy. I hope someone can help. The site displays perfectly in FF but all div's do not show in IE. Please help me find the problem! Thanks! Here is my css. .node-unpublished, .comment-unpublished { background-color : #594133; } .preview .node, .preview .comment { background-color : #ffffea; }
14
2528
by: issentia | last post by:
I'm working on this site: http://www.essenceofsoy.com/redesign/index2.html and I'm having a few problems with getting the layout exactly right. 1) When the menu items are rolled over, they cannot be clicked as links unless the mouse pointer is below the word. This happens in both Firefox and IE6. 2) In Firefox, the pink quote banner and two gray form boxes above and below the content aren't centered in the "content" div, and I can't...
0
9499
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
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
8998
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...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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
5405
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
5540
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4078
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.