#50 closed defect (fixed)
head attr and doctype weirdness in turbogears example
Reported by: | nerkles@… | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | 0.3 |
Component: | XPath support | Version: | devel |
Keywords: | turbogears | Cc: |
Description
I'm not sure if the problem is specific to the TG example, or a bug in markup, but here it is...
I'm finding that on templates which include TG widget code (e.g., automatically adds CSS and JS which is not explicitly in the template), that things get out of order (html tag before the DOCTYPE) and the head tag sucks in attrs from elements it contains.
Here's a snip of code that comes out:
<html lang="en"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head href="/static/css/texty.css" rel="stylesheet" type="text/css" media="screen"> <title>Edit page: Test Page</title><link href="/static/css/texty.css" rel="stylesheet" type="text/css" media="screen">
Change History (4)
comment:1 Changed 18 years ago by cmlenz
comment:2 Changed 18 years ago by nerkles
Ahh, I removed the py:attrs stuff from the head tag on all but sitetemplate.html, put DOCTYPES on all my sub-templates, and so far it looks like all is well. Thanks.
comment:3 Changed 18 years ago by cmlenz
- Resolution set to fixed
- Status changed from new to closed
Closing this as fixed… the DOCTYPE issue can be easily worked around, and the problem with attributes bubbling up should be fixed since [272].
comment:4 Changed 18 years ago by cmlenz
- Component changed from General to XPath support
The problem with attributes being “sucked up” should have been fixed in [272].
I can't reproduce out-of-order elements. The DOCTYPE appears at the top for me in the TurboGears example.
However, Markup (currently) doesn't enforce that a DOCTYPE declaration is the first thing being generated in the serialization stage. If, for example, your page template contains no DOCTYPE, but the master templates does, the DOCTYPE declaration from the master will be inserted at the place where the xi:include is made. This is remedied by declaring the DOCTYPE in the page template instead of—or in addition to—in the master template.
This should probably be fixed, but that would mean ignoring any DOCTYPE declaration after the first start tag was encountered.