1. Curtis Maloney
  2. gnocchi-forum

Commits

cur...@tinbrain.net  committed 188be52

Added bbcode template tag

  • Participants
  • Parent commits 675fae7
  • Branches default

Comments (0)

Files changed (2)

File gnocchi_forum/templatetags/__init__.py

  • Ignore whitespace
Empty file added.

File gnocchi_forum/templatetags/forum.py

View file
  • Ignore whitespace
+from django import template
+from django.utils.safestring import mark_safe
+
+register = template.Library()
+
+@register.filter
+def bbcode(value):
+    from postmarkup import render_bbcode
+    return mark_safe(render_bbcode(value))