mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
This commit is contained in:
committed by
Sarah Boyce
parent
4fcbdb11b1
commit
968397228f
@@ -15,7 +15,7 @@
|
||||
|
||||
<h1>{{ name }}</h1>
|
||||
|
||||
<h2 class="subhead">{{ summary|striptags }}</h2>
|
||||
<h2 class="subhead">{{ summary }}</h2>
|
||||
|
||||
{{ body }}
|
||||
|
||||
|
||||
@@ -242,3 +242,7 @@ def remove_non_capturing_groups(pattern):
|
||||
final_pattern += pattern[prev_end:start]
|
||||
prev_end = end
|
||||
return final_pattern + pattern[prev_end:]
|
||||
|
||||
|
||||
def strip_p_tags(value):
|
||||
return mark_safe(value.replace("<p>", "").replace("</p>", ""))
|
||||
|
||||
@@ -30,7 +30,7 @@ from django.utils.inspect import (
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from .utils import get_view_name
|
||||
from .utils import get_view_name, strip_p_tags
|
||||
|
||||
# Exclude methods starting with these strings from documentation
|
||||
MODEL_METHODS_EXCLUDE = ("_", "add_", "delete", "save", "set_")
|
||||
@@ -195,7 +195,7 @@ class ViewDetailView(BaseAdminDocsView):
|
||||
**{
|
||||
**kwargs,
|
||||
"name": view,
|
||||
"summary": title,
|
||||
"summary": strip_p_tags(title),
|
||||
"body": body,
|
||||
"meta": metadata,
|
||||
}
|
||||
@@ -384,7 +384,7 @@ class ModelDetailView(BaseAdminDocsView):
|
||||
**{
|
||||
**kwargs,
|
||||
"name": opts.label,
|
||||
"summary": title,
|
||||
"summary": strip_p_tags(title),
|
||||
"description": body,
|
||||
"fields": fields,
|
||||
"methods": methods,
|
||||
|
||||
Reference in New Issue
Block a user