Issue with formatting of code when using the upsert API
We're implementing our "Get Script Help" help panel inside SoundFlow, where a user can click a button to get help with the current script, and it will ask them a few questions before then auto-generating a forum entry for them.
You can see an example here:
As you can see, the code (using the three backticks method) doesn't get properly shown. If I manually edit the body text and then save in the browser, it will be shown correctly.
Any workaround we can apply to make sure the code displays correctly?
- 7 replies
Probably because the upsert API expects html not CommonMark.
I think I should change so CommonMark will be the default, otherwise "everyone" who uses this API will get confused.
Ok with you? Thereafter
```should work as expected directly.
There can also be a
bodyMarkupLangfield which the API caller could set to
<pre><code>or sth like that, instead of
```, should work also before the server has started accepting CommonMark. However that's not so user friendly if people want to edit their posts later
It would be great to switch to CommonMark so it works exactly like input in the browser :) That's easy to understand for everybody.
On this same note by the way - the notification emails display html tags right now when coming from an API generated thread/post.
So there should probably be some filtering of the content that goes out into the emails when it's coming from the API.
I think I've fixed all these things (last week). I have in mind to upgrade your server this evening or tomorrow morning.
(The emails — oddly enough, I previously inserted the raw CommonMark source in the email quotes (sanitized). Now it'll be just the text, without any formatting, instead)
Sounds great, let me know when it's live and I'll make a test :)
- Progresswith handling this problem
- @KajMagnus marked this topic as Started 2020-06-08 10:03:59.801Z.
- @KajMagnus marked this topic as Done 2020-06-16 07:37:03.420Z.