mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Allow dependent questions to depend on multiple values (#1336)
This commit is contained in:
@@ -9,8 +9,23 @@ _json_escapes = {
|
||||
ord('&'): '\\u0026',
|
||||
}
|
||||
|
||||
_json_escapes_attr = {
|
||||
ord('>'): '\\u003E',
|
||||
ord('<'): '\\u003C',
|
||||
ord('&'): '\\u0026',
|
||||
ord('"'): '"',
|
||||
ord("'"): ''',
|
||||
ord("="): '=',
|
||||
}
|
||||
|
||||
|
||||
@keep_lazy(six.text_type, SafeText)
|
||||
def escapejson(value):
|
||||
"""Hex encodes characters for use in a application/json type script."""
|
||||
return mark_safe(force_text(value).translate(_json_escapes))
|
||||
|
||||
|
||||
@keep_lazy(six.text_type, SafeText)
|
||||
def escapejson_attr(value):
|
||||
"""Hex encodes characters for use in a html attributw script."""
|
||||
return mark_safe(force_text(value).translate(_json_escapes_attr))
|
||||
|
||||
Reference in New Issue
Block a user