The usage of hx-post to /api/format and hx-target for the input textarea did not have the same effect as with the other usages of swapping the text response from the server.
This ticket tracks both the investigation and removal of the handleFormat JS function hack to get this working, in favour of a pure htmx solution for simplicity.