'Strips HTML tags, whitespace and wiki markup from the HTML source, including:
metadata, info box, table of contents, annotations, thumbnails, disambiguation link.
This is called internally from MediaWikiArticle.string.'

def _plaintext(self, string, **kwargs):

    s = string
    s = strip_element(s, 'table', 'id="toc')
    s = strip_element(s, 'table', 'class="infobox')
    s = strip_element(s, 'table', 'class="navbox')
    s = strip_element(s, 'table', 'class="mbox')
    s = strip_element(s, 'table', 'class="metadata')
    s = strip_element(s, 'table', 'class=".*?wikitable')
    s = strip_element(s, 'table', 'class="toc')
    s = strip_element(s, 'div', 'id="toc')
    s = strip_element(s, 'div', 'class="infobox')
    s = strip_element(s, 'div', 'class="navbox')
    s = strip_element(s, 'div', 'class="mbox')
    s = strip_element(s, 'div', 'class="metadata')
    s = strip_element(s, 'div', 'id="annotation')
    s = strip_element(s, 'div', 'class="dablink')
    s = strip_element(s, 'div', 'class="magnify')
    s = strip_element(s, 'div', 'class="thumb    ')
    s = strip_element(s, 'div', 'class="barbox')
    s = strip_element(s, 'div', 'class="noprint')
    s = strip_element(s, 'sup', 'class="noprint')
    s = strip_element(s, 'div', 'style="position:absolute')
    s = strip_element(s, 'span', 'class="error')
    s = re.sub('<img    class=\\"tex\\".*?/>', '[math]', s)
    s = plaintext(s, **kwargs)
    s = re.sub('\\[edit\\]\\s*', '', s)
    s = re.sub(('\\[%s\\]\\s*' % {'en': 'edit', 'es': u'editar    c\xf3digo', 'de': 'Bearbeiten', 'fr': 'modifier    le    code', 'it': 'modifica    sorgente', 'nl': 'bewerken'}.get(self.language, 'edit')), '', s)
    s = s.replace('[', '    [').replace('        [', '    [')
    return s
