Permalink
Browse files

json api: Add body_html attribute.

Same format as for standard things.
  • Loading branch information...
1 parent 5f42d46 commit 02f0e7149dd698f29e5e12c12caf658f74475ec3 @spladug spladug committed Feb 24, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 reddit_liveupdate/pages.py
View
4 reddit_liveupdate/pages.py
@@ -7,6 +7,7 @@
from pylons import c, g
from pylons.i18n import _, ungettext
+from r2.lib import filters
from r2.lib.pages import Reddit, UserTableItem
from r2.lib.menus import NavMenu, NavButton
from r2.lib.template_helpers import add_sr
@@ -188,11 +189,14 @@ class LiveUpdateJsonTemplate(ThingJsonTemplate):
_data_attrs_ = ThingJsonTemplate.data_attrs(
id="_id",
body="body",
+ body_html="body_html",
)
def thing_attr(self, thing, attr):
if attr == "_id":
return str(thing._id)
+ elif attr == "body_html":
+ return filters.spaceCompress(filters.safemarkdown(thing.body))
return ThingJsonTemplate.thing_attr(self, thing, attr)
def kind(self, wrapped):

0 comments on commit 02f0e71

Please sign in to comment.