Opened 18 years ago

Closed 14 years ago

Last modified 6 weeks 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

Description

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@…> 18 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Simon G. <dev@…>, 18 years ago

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

comment:2 by Simon G. <dev@…>, 18 years ago

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

comment:3 by Simon G. <dev@…>, 18 years ago

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).

by Simon G. <dev@…>, 18 years ago

Attachment: admin_doc.diff added

comment:4 by Simon G. <dev@…>, 18 years ago

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

comment:5 by Luke Plant, 16 years ago

Patch needs improvement: set

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

comment:6 by Ramiro Morales, 14 years ago

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.

comment:7 by Sarah Boyce <42296566+sarahboyce@…>, 6 weeks ago

In 96839722:

Fixed #35867, Refs #2411 -- Allowed links in admindocs view details summary.

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