Issue with formatting of code when using the upsert API
Hi @KajMagnus
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:
https://forum.soundflow.org/-2207/question-5
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?
- KajMagnus @KajMagnus2020-06-01 05:48:39.626Z2020-06-01 06:04:38.739Z
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
bodyMarkupLang
field which the API caller could set toHTML
orCommonMark
.Any workaround
<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- CChristian Scheuer @chrscheuer
It would be great to switch to CommonMark so it works exactly like input in the browser :) That's easy to understand for everybody.
- CChristian Scheuer @chrscheuer
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.- KajMagnus @KajMagnus2020-06-08 10:03:42.366Z
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)
- CChristian Scheuer @chrscheuer
Sounds great, let me know when it's live and I'll make a test :)
- KajMagnus @KajMagnus2020-06-09 09:20:25.980Z
Ok, now I just upgraded the server — so now you can make test at any time
- CChristian Scheuer @chrscheuer
Awesome! It works :)
- Progresswith handling this problem