| |
@@ -29,6 +29,7 @@
|
| |
import sqlalchemy as sa
|
| |
from sqlalchemy.orm import relation
|
| |
from sqlalchemy.orm.session import object_session
|
| |
+ from markdown import markdown
|
| |
|
| |
from hubs.authz import ObjectAuthzMixin, AccessLevel
|
| |
from hubs.database import BASE, Session
|
| |
@@ -38,6 +39,7 @@
|
| |
from hubs.utils import username2avatar
|
| |
from hubs.utils.fedmsg import publish
|
| |
from hubs.signals import hub_created
|
| |
+ from hubs.widgets import clean_input
|
| |
from .association import Association
|
| |
from .constants import ROLES, HUB_TYPES
|
| |
from .hubconfig import HubConfigProxy
|
| |
@@ -309,6 +311,12 @@
|
| |
"mtime": self.last_refreshed,
|
| |
"type": self.hub_type,
|
| |
}
|
| |
+ if result["config"]["description"]:
|
| |
+ result["description_md2html"] = {
|
| |
+ '__html': clean_input.clean(markdown(result["config"]["description"],
|
| |
+ extensions=['markdown.extensions.extra',
|
| |
+ 'markdown.extensions.sane_lists']))
|
| |
+ }
|
| |
for assoc in sorted(self.associations, key=lambda a: a.user.username):
|
| |
if assoc.role not in ROLES:
|
| |
continue
|
| |
Closes #541