move filter to separate function to honor autoescape, place Markdown instance in app config