Jump to content

Gc.com Changes My Html Code


BigFurryMonster

Recommended Posts

Yesterday, I was putting together a new cache page (listing). I had coded some HTML offline, and the page looked fine. After I had copy-pasted this code into the cache description box, the page looked quite different than it did offline. It turned out my HTML had been changed by ... gc.com.

For example, I put a couple of "font" tags around the entire text. Gc.com moved these tags to only include one paragraph.

 

Is the gc.com engine correcting my (bad?) HTML coding somehow?

Link to comment

Geocaching.com uses "HTML Tidy" to clean up various formatting errors. Also, certain HTML codes are not allowed on cache pages due to the possibility of improper use. One or both of these things could produce the effect you described. If you link to your cache page or give further details about what you were trying to do (use the UBB "Code" command), perhaps we could be of more assistance.

Link to comment

Geocaching.com uses "HTML Tidy" to clean up various formatting errors. Also, certain HTML codes are not allowed on cache pages due to the possibility of improper use. One or both of these things could produce the effect you described. If you link to your cache page or give further details about what you were trying to do (use the UBB "Code" command), perhaps we could be of more assistance.

 

Aaahhhh! That at least confirms I'm not going crazy (changing HTML code)...

 

I was doing something like this:

<font face="verdana">
<table>
TableContents
</table>
<h3>Header</h3>
</font>

 

which was turned into something like this:

 

<table>
TableContents
</table>
<h3><font face="verdana">Header</font></h3>

 

I'd like everything to be in Verdana Font, but as you can see, the table was taken out of the tags (of course - in this case, the standard font on gc.com is Verdana, but the PDF looks horrible).

Link to comment

Well according to netmechanic page Wrapping Tables Inside a FONT Tag the html standard says

Unlike most HTML elements, you couldn't set the table's typeface just by nesting the table tags inside a FONT element. Instead, you had to apply the FONT tag inside each cell of the table.
It also says
However, newer versions of Internet Explorer no longer follow this rule. All versions of MSIE 5, and some versions of MSIE 4 disregard the HTML Content Model for tables. That means that you can now nest a TABLE tag inside a FONT element, and have the table inherit all font properties.

 

Is this a good thing? Maybe not. While Microsoft may have made it easier to write your HTML code, they've also created a new browser compatibility headache. Other browsers and most older versions of MSIE still apply the Content Model to tables.

. and
But be sure to keep this difference in mind if you develop your pages exclusively with MSIE 5.0. Just because the table font is set for your browser doesn't mean it will be for all of your site's visitors.
So it appears that htmltidy is making the html fit the standard, so that it will work in most browsers instead of just IE 5 and higher. Edited by AllenLacy
Link to comment

Technically, according to the HTML spec, FONT can only have other "inline" elements within it. It cannot contain block-level elements, such as TABLE. HTML-Tidy is forcing you to obey the spec.

 

IMO this is a Good Thing. Just because some browsers allow and support bad HTML doesn't make it right :laughing:

Link to comment

Hey, don't trademark the Good Things!

 

Thanks for the advice. It's probably not possible to use my own stylesheets (it's what HTML-help recommends, but I'm guessing gc.com uses its own), so I'll look for other ways to produce correct HTML.

 

Is the HTML-Tidy-Tool publicly available? This saves me the trouble of having to edit my HTML in the small window provided by gc.com.

Link to comment

Hey, don't trademark the Good Things!

 

Thanks for the advice. It's probably not possible to use my own stylesheets (it's what HTML-help recommends, but I'm guessing gc.com uses its own), so I'll look for other ways to produce correct HTML.

 

Is the HTML-Tidy-Tool publicly available? This saves me the trouble of having to edit my HTML in the small window provided by gc.com.

 

Looks like there is an online HTML Tidy tool here.

Link to comment

Geocaching.com uses "HTML Tidy" to clean up various formatting errors. Also, certain HTML codes are not allowed on cache pages due to the possibility of improper use. One or both of these things could produce the effect you described. If you link to your cache page or give further details about what you were trying to do (use the UBB "Code" command), perhaps we could be of more assistance.

 

Aaahhhh! That at least confirms I'm not going crazy (changing HTML code)...

 

I was doing something like this:

<font face="verdana">
<table>
TableContents
</table>
<h3>Header</h3>
</font>

 

which was turned into something like this:

 

<table>
TableContents
</table>
<h3><font face="verdana">Header</font></h3>

 

I'd like everything to be in Verdana Font, but as you can see, the table was taken out of the tags (of course - in this case, the standard font on gc.com is Verdana, but the PDF looks horrible).

 

I've had success with inline CSS syntax. Unfortunately there's no way to insert a STYLE tag int the header right now - they you could use the cascade properly.

 

Try <table style="font-family : verdana ;"> if that doesn't work, try <td style="font-family : verdana ;">

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...