Opened 10 years ago

Closed 5 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: UI/UX:


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

Download all attachments as: .zip

Change History (7)

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

  • Cc dev@… added
  • Owner changed from adrian to anonymous
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

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

  • Owner changed from anonymous to Simon G.
  • Status changed from assigned to new

comment:3 Changed 9 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 9 years ago by Simon G. <dev@…>

comment:4 Changed 9 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 8 years ago by lukeplant

  • Patch needs improvement set

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

comment:6 Changed 5 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

(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