Parent: [fa63e0] (diff)

Child: [df8009] (diff)

Download this file

converters.py    13 lines (9 with data), 301 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#-*- python -*-
import html2text
# https://github.com/zikzakmedia/python-mediawiki.git
from mediawiki import wiki2html
html2text.BODY_WIDTH = 0
def mediawiki2markdown(source):
wiki_content = wiki2html(source, True)
markdown_text = html2text.html2text(wiki_content)
return markdown_text