summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags/projecttags.py')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 4a97eb7ac4..99fd4cf287 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -25,6 +25,7 @@ from django import template
25from django.utils import timezone 25from django.utils import timezone
26from django.template.defaultfilters import filesizeformat 26from django.template.defaultfilters import filesizeformat
27import json as JsonLib 27import json as JsonLib
28from django.utils.safestring import mark_safe
28 29
29register = template.Library() 30register = template.Library()
30 31
@@ -49,7 +50,10 @@ def mapselect(value, argument):
49 50
50@register.filter(name = "json") 51@register.filter(name = "json")
51def json(value): 52def json(value):
52 return JsonLib.dumps(value) 53 # JSON spec says that "\/" is functionally identical to "/" to allow for HTML-tag embedding in JSON strings
54 # unfortunately, I can't find any option in the json module to turn on forward-slash escaping, so we do
55 # it manually here
56 return mark_safe(JsonLib.dumps(value, ensure_ascii=False).replace('</', '<\\/'))
53 57
54@register.assignment_tag 58@register.assignment_tag
55def query(qs, **kwargs): 59def query(qs, **kwargs):