Opened 14 years ago

Closed 9 years ago

#2411 closed defect (fixed)

Validation errors in template filters/tags documentation

Reported by: James Wheare <django@…> Owned by: nobody
Component: contrib.admin Version:
Severity: normal Keywords: documentation, admin, docstring, validation, html
Cc: dev@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


The documentation pages in the built in admin have swathes of HTML validation errors mainly involving nested p tags. These occur in the template tags/filters and views pages. This is probably due to idiosyncratic docstring->html parsing.

There are also some unescaped href attributes on the bookmarklets page due to the killer javascript-fu.

Attachments (1)

admin_doc.diff (4.9 KB) - added by Simon G. <dev@…> 13 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 years ago by Simon G. <dev@…>

Cc: dev@… added
Owner: changed from Adrian Holovaty to anonymous
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 Changed 13 years ago by Simon G. <dev@…>

Owner: changed from anonymous to Simon G.
Status: assignednew

comment:3 Changed 13 years ago by Simon G. <dev@…>

Has patch: set

This should fix most of them. The 5 outstanding errors should clear up once #3696 and #3695 are sorted out.

For the record, most of the errors were due to the use of <p>{{ some_var }}</p> - ReST automatically adds <p> tag anyway, so we were ending up with <p><p>...</p></p>. I've fixed this by just doing {{ some_var }} .

The next problem was related to this - ReST was generating <p> tags around things which we were putting into header tags. I've used the removetags filter to strip any <p>'s from header tags to stop this. It's likely that this could be replaced with striptags instead to remove all other html tags in the headers.

Finally, I've escaped a few variables that should have been escaped (mainly things which haven't gone through ReST like tag names,etc).

Changed 13 years ago by Simon G. <dev@…>

Attachment: admin_doc.diff added

comment:4 Changed 13 years ago by Simon G. <dev@…>

... and for the record, the bookmarklets page validates quite happily, so this must have been fixed previously.

comment:5 Changed 12 years ago by Luke Plant

Patch needs improvement: set

The patch needs significant updating, due to autoescape and possibly other changes.

comment:6 Changed 9 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

(In [14920]) Fixed #2411 -- Fixed some XHTML validation errors in admindocs pages. Thanks to James Wheare for the report and to Simon Greenhill for the patch.

Note: See TracTickets for help on using tickets.
Back to Top