'Given wiki markup, return HTML.
Pass a locale to get all the hooks to look up Documents or
Media (Video, Image) for that locale. We key Documents by
title and locale, so both are required to identify it for a
e.g. link.
Since py-wikimarkup\'s hooks don\'t offer custom paramters for
callbacks, we\'re using self.locale to keep things simple.
:arg text: the text to parse
:arg show_toc: should we show a table of contents?
:arg tags: the allowed html tags
:arg attributes: the allowed html attributes
:arg styles: the allowed css styles
:arg locale: the locale to use
:arg nofollow: should links have nofollow set?
:arg youtube_embeds: should we replace the youtube placeholders
with the iframes? This is kind of a hack so that subclasses
can skip embedding here and do it on their own at the end
of parsing.'

def parse(self, text, show_toc=None, tags=None, attributes=None, styles=None, locale=settings.WIKI_DEFAULT_LANGUAGE, nofollow=False, youtube_embeds=True, **kwargs):

    self.locale = locale
    if tags:
        kwargs['tags'] = tags
    @email_utils.safe_translation
    def _parse(locale):
        return super(WikiParser, self).parse(text, show_toc=show_toc, tags=(tags or ALLOWED_TAGS), attributes=(attributes or ALLOWED_ATTRIBUTES), styles=(styles or ALLOWED_STYLES), nofollow=nofollow, strip_comments=True, **kwargs)
    html = _parse(locale)
    if youtube_embeds:
        html = self.add_youtube_embeds(html)
    return html
