Django

Code

Ticket #2411 (new)

Opened 2 years ago

Last modified 1 year ago

Validation errors in template filters/tags documentation

Reported by: James Wheare <django@sparemint.com> Assigned to: nobody
Milestone: Component: Admin interface
Version: Keywords: documentation, admin, docstring, validation, html
Cc: dev@simon.net.nz Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

admin_doc.diff (4.9 kB) - added by Simon G. <dev@simon.net.nz> on 03/10/07 03:42:21.

Change History

03/10/07 00:25:34 changed by Simon G. <dev@simon.net.nz>

  • cc set to dev@simon.net.nz.
  • owner changed from adrian to anonymous.
  • status changed from new to assigned.
  • stage changed from Unreviewed to Accepted.

03/10/07 00:26:45 changed by Simon G. <dev@simon.net.nz>

  • owner changed from anonymous to Simon G..
  • status changed from assigned to new.

03/10/07 03:41:53 changed by Simon G. <dev@simon.net.nz>

  • has_patch set to 1.

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

03/10/07 03:42:21 changed by Simon G. <dev@simon.net.nz>

  • attachment admin_doc.diff added.

03/10/07 03:44:12 changed by Simon G. <dev@simon.net.nz>

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


Add/Change #2411 (Validation errors in template filters/tags documentation)




Change Properties
Action