

def markdown(url):
    ' http://mikelev.in/2014/01/stripping-html-text-markdown-readability/ '
    html = url
    if checkurl(url):
        html = gethtml(url)
        if (not html):
            return None
    html = barebones(html)
    html = html.replace('<p>', '\n')
    html = html.replace('</p>', '')
    html = html.replace('<hr>', '\n---\n')
    html = html.replace('<blockquote>', '\n> ')
    html = html.replace('</blockquote>', '')
    html = html.replace('<h1>', '\n# ')
    html = html.replace('<h2>', '\n## ')
    html = html.replace('<h3>', '\n### ')
    html = html.replace('<h4>', '\n#### ')
    html = html.replace('<h5>', '\n##### ')
    html = html.replace('<h6>', '\n###### ')
    html = html.replace('</h1>', '')
    html = html.replace('</h2>', '')
    html = html.replace('</h3>', '')
    html = html.replace('</h4>', '')
    html = html.replace('</h5>', '')
    html = html.replace('</h6>', '')
    html = html.replace('<li>', '')
    html = html.replace('</li>', '')
    html = html.replace('<ul>', '')
    html = html.replace('<ol>', '')
    html = html.replace('</ul>', '')
    html = html.replace('</ol>', '')
    html = lesslines(html)
    html = html.strip()
    return html

dataset/ETHPy150Open miklevin/pipulate/common.py markdown/original