Add method for <code> tag

Add method and tests for inline tag <code>.
This commit is contained in:
Andrew Richards
2020-11-23 16:16:10 +00:00
parent 25d68b4265
commit 3354f143d8
3 changed files with 41 additions and 0 deletions

View File

@@ -143,6 +143,18 @@ class MarkdownConverter(object):
return ''
return '%s*%s*%s' % (prefix, text, suffix)
def convert_code(self, el, text):
prefix, suffix, text = chomp(text)
if not text:
return ''
return '%s`%s`%s' % (prefix, text, suffix)
def convert_samp(self, el, text):
return self.convert_code(el, text)
def convert_kbd(self, el, text):
return self.convert_code(el, text)
def convert_hn(self, n, el, text):
style = self.options['heading_style']
text = text.rstrip()