from django import template


register = template.Library()


@register.filter
def get_style(tags, priority):
    max_priority = max(tags, key=lambda tag: tag["priority"])["priority"]
    size = (max_priority / 10.) * priority
    return "font-size: {}em;".format(size)

@@ -188,17 +188,22 @@
  size = 
-(
+100 / 
 max_prio
@@ -212,15 +212,8 @@
 ty /
- 10.) *
  pri
@@ -217,16 +217,20 @@
 priority
+ / 2
 %0A    ret

Fix tag cloud weird size