Skip to content

Commit ecc6cb9

Browse files
committed
Fix line breaks in IESG telechat moderator package
- Legacy-Id: 1885
1 parent 840c82e commit ecc6cb9

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

ietf/idtracker/templatetags/ietf_filters.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ def remove_empty_lines(text):
304304
text = re.sub("( *\n){2,}", "\n", text)
305305
return text
306306

307+
@register.filter(name='linebreaks_crlf')
308+
def linebreaks_crlf(text):
309+
"""
310+
Normalize all linebreaks to CRLF.
311+
"""
312+
# First, map CRLF to LF
313+
text = text.replace("\r\n", "\n")
314+
# Next, map lone CRs to LFs
315+
text = text.replace("\r", "\n")
316+
# Finally, map LFs to CRLFs
317+
text = text.replace("\n", "\r\n")
318+
return text
319+
307320
@register.filter(name='greater_than')
308321
def greater_than(x, y):
309322
return x > int(y)

ietf/templates/iesg/moderator_doc.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@
3838
{% for doc in section_docs %}
3939
<h3>{{ title1 }}<br>
4040
{{ title2 }}<br>
41-
{{ title3 }} ({{ forloop.counter }} of {{ section_docs|length }})</h3>
41+
{{ title3 }} ({{ forloop.counter }} of {{ section_docs|length }})</h3>
4242

4343
<p><b>{{doc.obj.document.filename}}{% if not doc.obj.rfc_flag %}-{{doc.obj.document.revision}}{% endif %}</b><br>
4444
<i>({{ doc.obj.document.title|escape }})</i><br>
4545
<b>Intended Status: {{ doc.obj.document.intended_status }}<br>
4646
Token: {{ doc.obj.token_name|escape }}</b></p>
4747

48-
<small><pre>{% if doc.obj.ballot.active %}
48+
49+
<small>{% filter linebreaks_crlf %}<pre>{% if doc.obj.ballot.active %}
4950
Yes No-Objection Discuss Abstain
5051
{% if not doc.obj.ballot.an_sent %}{% for curpos in doc.obj.ballot.active_positions %}{{ curpos.ad|ljust:"20" }} {{ curpos.pos.yes|bracket }} {{ curpos.pos.noobj|bracket }} {{ curpos.pos.discuss|bracket }} {{ curpos.pos.abstain_ind|bracket }}
5152
{% endfor %}
5253
{% endif %}{% for position in doc.obj.ballot.positions.all|dictsort:"ad.last_name" %}{% if doc.obj.ballot.an_sent or not position.ad.is_current_ad %}{{ position.ad|ljust:"20" }} {{ position.yes|bracket }} {{ position.noobj|bracket }} {{ position.discuss|bracket }} {{ position.abstain_ind|bracket }}
53-
{% endif %}{% endfor %}{% else %}(Ballot not issued){% endif %}</pre></small>
54+
{% endif %}{% endfor %}{% else %}(Ballot not issued){% endif %}</pre><{% endfilter %}/small>
5455

5556
{% if doc.obj.document.lc_expiration_date and doc.obj.document.lc_expiration_date|timesince_days|less_than:"1" %}<p><b>NOTE: Last Call expires on {{ doc.obj.document.lc_expiration_date }}.</b></p>{% endif %}
5657

ietf/templates/iesg/moderator_package.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
{% endcomment %}{% comment %}
3434
Some parts Copyright (c) 2009 The IETF Trust, all rights reserved.
3535
{% endcomment %}<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
36+
{% load ietf_filters %}
3637
<html><head>
3738
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
3839
<style type="text/css">
@@ -77,9 +78,9 @@ <h3>1. Administrivia<br>1.3 Approval of the Minutes of Past Telechats</h3>
7778

7879
<h3>1. Administrivia<br>1.4 List of Remaining Action Items from Last Telehat</h3>
7980

80-
<pre>
81+
{% filter linebreaks_crlf %}<pre>
8182
{{ action_items }}
82-
</pre>
83+
</pre>{% endfilter %}
8384

8485
<!-- ===================================================================== -->
8586
<!-- SECTIONS 2+3 -->
@@ -133,9 +134,9 @@ <h3>6. Management Items<br>
133134

134135
<h3>7. Working Group News</h3>
135136

136-
<pre>
137+
{% filter linebreaks_crlf %}<pre>
137138
{% for name in ad_names %}[ ] {{ name }}
138139
{% endfor %}
139-
</pre>
140+
</pre>{% endfilter %}
140141

141142
</body></html>

0 commit comments

Comments
 (0)