import html2text
import os
import re
l = os.listdir(os.getcwd())
for file in l :
if file.endswith('.html'):
with open(file,'r',encoding='utf8') as f:
md = html2text.html2text(f.read())
pattern= r'-\n'
md_text = re.sub(pattern, '-', md)
with open(re.sub('html','md',file),'w',encoding='utf8') as nf:
nf.write(md_text)