#8885 closed (fixed)
HTML markup appearing in title of doc page
Reported by: | gkelly | Owned by: | nobody |
---|---|---|---|
Component: | *.djangoproject.com | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The page at http://docs.djangoproject.com/en/dev/ref/models/options/ has HTML markup appearing in the title for the page. I haven't seen this with other pages, but it's possible this isn't the only affected URL.
Attachments (1)
Change History (16)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Please ignore patch, a better solution would be to use a template filter to strip the HTML from the title, such as
Index: djangodocs/templates/docs/doc.html =================================================================== --- djangodocs/templates/docs/doc.html (revision 8965) +++ djangodocs/templates/docs/doc.html (working copy) @@ -1,6 +1,6 @@ {% extends "base_docs.html" %} -{% block title %}{{ doc.title }} | Django Documentation{% endblock %} +{% block title %}{{ doc.title|striptags }} | Django Documentation{% endblock %} {% block extrahead %} {{ block.super }}
comment:3 by , 16 years ago
Component: | Documentation → Django Web site |
---|---|
Has patch: | set |
Changing component; locally generated HTML (make html
) doesn't have this problem.
comment:4 by , 16 years ago
#9162 and #9160 were duplicates.
http://docs.djangoproject.com/en/dev/internals/release-process/ is also affected.
comment:5 by , 16 years ago
http://docs.djangoproject.com/en/dev/ref/contrib/comments/ also suffers from this strange disease :)
comment:6 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:7 by , 16 years ago
See also for another semi-related problem: #9517 (titles show up escaped in Browse section of the sidebar)
comment:8 by , 16 years ago
#9584 report his also for http://docs.djangoproject.com/en/dev/topics/cache/
comment:9 by , 16 years ago
#9647 was also a duplicate, and it suggested:
Maybe a |safe filter is needed to be appended to the title tag to allow these characters to be unescaped?
comment:10 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
#10495 reported this again and also suggested a striptags filter on the title tag.
comment:11 by , 16 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Meant to close the other one, not this one.
comment:13 by , 15 years ago
Patch needs improvement: | set |
---|
#11839 suggests striptags filter too, and has a patch. Modifying documentation to work around the current problem isn't the solution, so I'm marking the patch here as "needs improvement".
follow-up: 15 comment:14 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:15 by , 15 years ago
Replying to ubernostrum:
(In [11598]) Fixed #8885 and its many duplicates (hopefully) by stripping HTML (which implies mark_safe) to titles of documentation pages.
striptags has is_safe=True but that won't explicitly mark the output as safe, it will just preserve the safe status of input. We don't mark the title as safe, so it is still being escaped, which means titles with smart quotes, such as:
http://docs.djangoproject.com/en/dev/ref/contrib/sites/
http://docs.djangoproject.com/en/dev/ref/contrib/comments/
http://docs.djangoproject.com/en/dev/internals/release-process/
http://docs.djangoproject.com/en/dev/topics/cache/
are still looking a bit odd. Could we also just explicitly run doc.title
through the safe filter?
This page is also affected: http://docs.djangoproject.com/en/dev/ref/files/file/