Add MarkdownString.__html__().

This commit is contained in:
a_magical_me 2011-03-31 13:51:19 -07:00
parent b924a82236
commit bc0b4acb84
2 changed files with 7 additions and 2 deletions

View file

@ -31,11 +31,17 @@ class MarkdownString(object):
def __unicode__(self):
return self.source_text
def __str__(self):
return unicode(self.source_text).encode()
def __html__(self):
return self.as_html
@property
def as_html(self):
"""Returns the string as HTML4."""
if self._as_html:
if self._as_html is not None:
return self._as_html
md = markdown.Markdown(

View file

@ -145,4 +145,3 @@ except ImportError:
pass
return result