def render(self, scrap_data): output = "" try: output += formatter( scrap_data['markup'], filter_name=scrap_data['formatter'] ) except ImportError: output += "<!-- Cannot render HTML: '" + scrap_data['formatter'] + \ "' not found. -->" return output
def apply_markup(text, filter_name): return mark_safe(formatter(text, filter_name))