No internet connection
  1. Home
  2. Issues

Issue with formatting of code when using the upsert API

By Christian Scheuer @chrscheuer
    2020-05-31 14:04:18.552Z

    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?

    • 7 replies
    1. 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 to HTML or CommonMark.

      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

      1. CChristian Scheuer @chrscheuer
          2020-06-01 09:10:47.807Z

          It would be great to switch to CommonMark so it works exactly like input in the browser :) That's easy to understand for everybody.

          1. CChristian Scheuer @chrscheuer
              2020-06-01 09:11:42.083Z

              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.

              1. 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)

                1. CChristian Scheuer @chrscheuer
                    2020-06-09 08:08:49.405Z

                    Sounds great, let me know when it's live and I'll make a test :)

                    1. Ok, now I just upgraded the server — so now you can make test at any time

                      1. CChristian Scheuer @chrscheuer
                          2020-06-09 09:22:33.881Z

                          Awesome! It works :)

              2. Progress
                with handling this problem
              3. @KajMagnus marked this topic as Started 2020-06-08 10:03:59.801Z.
              4. @KajMagnus marked this topic as Done 2020-06-16 07:37:03.420Z.