diff --git a/bbj.el b/bbj.el index a526ad2..0f82362 100644 --- a/bbj.el +++ b/bbj.el @@ -472,6 +472,7 @@ it worked on emacs 24." (bbj-enter) (unless (eql buffer (current-buffer)) (bbj-edit-post)))) + (let* ((post (alist-get 'post_id (bbj-post-prop 'data))) (adminp (bbj-request "is_admin" 'target_user bbj-username)) (message (alist-get 'body (bbj-post-prop 'data))) @@ -485,6 +486,7 @@ it worked on emacs 24." (message bbj-descend request 'error 'description) (message "post edited") (bbj-enter-thread ,thread-id)))))) + (cond ((numberp (bbj-descend query 'error 'code)) (message (bbj-descend query 'error 'description))) diff --git a/src/endpoints.py b/src/endpoints.py index 35a38dc..9317ac3 100644 --- a/src/endpoints.py +++ b/src/endpoints.py @@ -166,8 +166,13 @@ def edit_post(json): ok, obj = db.edit_handler(json, thread) if ok: + + if json.get("reformat"): + json["body"] = formatting.parse(json["body"]) + obj["body"] = json["body"] obj["lastmod"] = time() obj["edited"] = True db.thread_dump(json["thread_id"], thread) + return obj