1id-index.txt: Clean CRs and other junk whitespace from document titles
- Legacy-Id: 2195
This commit is contained in:
parent
c0f88bd09b
commit
9e4087fd98
|
@ -312,6 +312,11 @@ def linebreaks_lf(text):
|
|||
text = text.replace("\r", "\n")
|
||||
return text
|
||||
|
||||
@register.filter(name='clean_whitespace')
|
||||
def clean_whitespace(text):
|
||||
text = re.sub("[\000-\040]+", " ", text)
|
||||
return text.strip()
|
||||
|
||||
@register.filter(name='unescape')
|
||||
def unescape(text):
|
||||
"""
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% load ietf_filters %}{% block intro %} Current Internet-Drafts
|
||||
{% autoescape off %}{% load ietf_filters %}{% block intro %} Current Internet-Drafts
|
||||
This summary sheet provides an index of each Internet-Draft
|
||||
These drafts are listed alphabetically by Working Group acronym and
|
||||
initial post date.
|
||||
{% endblock %}
|
||||
{% for group in groups|dictsort:"group_acronym.acronym" %}{% if group.active_drafts %}
|
||||
{{ group.group_acronym.name|safe }} ({{ group.group_acronym.acronym}})
|
||||
{% filter dashify %}{{ group.group_acronym.name|safe }} ({{ group.group_acronym.acronym}}){% endfilter %}
|
||||
{{ group.group_acronym.name }} ({{ group.group_acronym.acronym}})
|
||||
{% filter dashify %}{{ group.group_acronym.name }} ({{ group.group_acronym.acronym}}){% endfilter %}
|
||||
{% for draft in group.active_drafts|stable_dictsort:"filename"|stable_dictsort:"start_date" %}
|
||||
{% filter id_index_wrap %}
|
||||
"{{draft.title.strip|safe}}", {% for author in draft.authors.all|dictsort:"final_author_order" %}{{author.person|safe}}, {% endfor %}{{draft.revision_date|date:"j-M-y"}}, <{{draft.filename}}-{{draft.revision}}{{draft.file_type|id_index_file_types}}>
|
||||
"{{draft.title.strip|clean_whitespace}}", {% for author in draft.authors.all|dictsort:"final_author_order" %}{{author.person}}, {% endfor %}{{draft.revision_date|date:"j-M-y"}}, <{{draft.filename}}-{{draft.revision}}{{draft.file_type|id_index_file_types}}>
|
||||
{% endfilter %}{% block abstract %}{% endblock %}
|
||||
{% endfor %}{%endif %}{% endfor %}
|
||||
{% endfor %}{%endif %}{% endfor %}{% endautoescape %}
|
||||
|
|
Loading…
Reference in a new issue