adjust if block formatting
remove unnecessary escaping from the footer template