Merge pull request #2398 from bookwyrm-social/html-in-activitypub
Render markdown to html when using activitypub
This commit is contained in:
commit
bb5564461c
3 changed files with 17 additions and 13 deletions
|
@ -13,6 +13,7 @@ from django.forms import ClearableFileInput, ImageField as DjangoImageField
|
|||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.encoding import filepath_to_uri
|
||||
from markdown import markdown
|
||||
|
||||
from bookwyrm import activitypub
|
||||
from bookwyrm.connectors import get_image
|
||||
|
@ -499,6 +500,9 @@ class HtmlField(ActivitypubFieldMixin, models.TextField):
|
|||
return None
|
||||
return clean(value)
|
||||
|
||||
def field_to_activity(self, value):
|
||||
return markdown(value) if value else value
|
||||
|
||||
|
||||
class ArrayField(ActivitypubFieldMixin, DjangoArrayField):
|
||||
"""activitypub-aware array field"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue