Skip to content

Commit

Permalink
JSON serialization for markdown fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jun 15, 2019
1 parent 35116a9 commit 82d6e6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion baseframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from coaster.assets import split_namespec
from coaster.auth import current_auth, request_has_auth
from coaster.sqlalchemy import RoleAccessProxy
from coaster.sqlalchemy import RoleAccessProxy, MarkdownComposite

try:
from flask_debugtoolbar import DebugToolbarExtension
Expand Down Expand Up @@ -86,6 +86,8 @@ def default(self, o):
return o.url
if isinstance(o, types.GeneratorType):
return list(o)
if isinstance(o, MarkdownComposite):
return {'text': o.text, 'html': o.html}
return super(JSONEncoder, self).default(o)


Expand Down

0 comments on commit 82d6e6b

Please sign in to comment.