diff --git a/pokedex/db/markdown.py b/pokedex/db/markdown.py index 616830a..09f8067 100644 --- a/pokedex/db/markdown.py +++ b/pokedex/db/markdown.py @@ -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( diff --git a/pokedex/util.py b/pokedex/util.py index 5231259..d9aec70 100644 --- a/pokedex/util.py +++ b/pokedex/util.py @@ -145,4 +145,3 @@ except ImportError: pass return result -