b and strong tag conversion

This commit is contained in:
Matthew Tretter
2012-06-29 13:05:48 -04:00
parent 9798a14f19
commit de92943b32
2 changed files with 12 additions and 0 deletions

View File

@@ -65,6 +65,9 @@ class MarkdownConverter(object):
text = (text or '').rstrip()
return '%s\n%s\n\n' % (text, pad_char * len(text)) if text else ''
def convert_b(self, el):
return self.convert_strong(el)
def convert_em(self, el):
return '_%s_' % el.text if el.text else ''
@@ -80,6 +83,9 @@ class MarkdownConverter(object):
def convert_i(self, el):
return self.convert_em(el)
def convert_strong(self, el):
return '**%s**' % el.text if el.text else ''
def markdownify(html, strip=None, keep=None):
converter = MarkdownConverter(strip, keep)