skip premature test
[wolnelektury.git] / src / catalogue / templatetags / catalogue_tags.py
index 117abba..d5e7e05 100644 (file)
@@ -356,7 +356,7 @@ def work_list(context, object_list):
 
 @register.inclusion_tag('catalogue/plain_list.html', takes_context=True)
 def plain_list(context, object_list, with_initials=True, by_author=False, choice=None, book=None, gallery=False,
-               paged=True):
+               paged=True, initial_blocks=False):
     names = [('', [])]
     last_initial = None
     for obj in object_list:
@@ -490,3 +490,10 @@ def choose_fragment(request, book_id=None, tag_ids=None, unless=False):
         fragment_count = fragments.count()
         fragment = fragments[randint(0, fragment_count - 1)] if fragment_count else None
     return fragment.pk if fragment is not None else None
+
+
+@register.filter
+def strip_tag(html, tag_name):
+    # docelowo może być warto zainstalować BeautifulSoup do takich rzeczy
+    import re
+    return re.sub(r"<.?%s\b[^>]*>" % tag_name, "", html)