Skip to content

Commit bf75cd1

Browse files
committed
Added a template filter to do required escaping in iCalendar pages.
- Legacy-Id: 6533
1 parent 04e3a48 commit bf75cd1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,4 +490,8 @@ def plural(text, list, arg=u's'):
490490
return text
491491
else:
492492
return text + pluralize(len(list), arg)
493-
493+
494+
@register.filter
495+
def ics_esc(text):
496+
text = re.sub(r"([\n,;\\])", r"\\\1", text)
497+
return text

0 commit comments

Comments
 (0)