use the result as an argument for the call to the function mark_safe, return the result. decorator function register.filter with 2 arguments is_safe set to boolean True and needs_autoescape set to boolean True.
@ register . filter ( is_safe = True , needs_autoescape = True )