Skip to content

Commit

Permalink
send review content in markdown by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Her Email authored and alphatownsman committed Nov 19, 2023
1 parent 6b48473 commit d81743a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions journal/models/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def ap_object(self):
"id": self.absolute_url,
"type": "Review",
"name": self.title,
"content": self.html_content,
# "content": self.html_content,
"content": self.body,
"mediaType": "text/markdown",
"published": self.created_time.isoformat(),
"updated": self.edited_time.isoformat(),
"attributedTo": self.owner.actor_uri,
Expand All @@ -51,9 +53,14 @@ def ap_object(self):

@classmethod
def update_by_ap_object(cls, owner, item, obj, post_id, visibility):
content = (
obj["content"]
if obj.get("mediaType") == "text/markdown"
else md(obj["content"])
)
d = {
"title": obj["name"],
"body": md(obj["content"].strip()),
"body": content,
"local": False,
"remote_id": obj["id"],
"visibility": visibility,
Expand Down

0 comments on commit d81743a

Please sign in to comment.