import re


def clean_pre(content):
    """
    Clean old <pre> tags with old classes and convert them to <pre><code>
    """
    result = re.sub(r'<pre class=\"lang.*?>', '<pre>', content)
    result = result.replace('<pre>', '<pre><code>')
    result = result.replace('</pre>', '</code></pre>')
    result = result.replace('<code><code>', '<code>')
    result = result.replace('</code></code>', '</code>')
    return result