Code formatting in forum posts?

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Joakim Joakim 2 years, 11 months ago.

  • Author
    Posts
  • #15147
    Profile photo of Joakim
    Joakim
    Participant

    I need help... I have tried to enter code into a post I put my code in the < code > element. The issue I have is that there is a duplicate block of code tags generated (I think?) so the post looks really ugly and it is hard to see the entire code.

    Can anyone help my by letting me know the correct way to add PowerShell code to a post/reply?

  • #15154
    Profile photo of Don Jones
    Don Jones
    Keymaster

    WordPress natively likes to use the back tick for code, which for us PowerShell people can obviously be a problem. Mike's right in that editing your post makes it fairly easy to fix. I've looked into it a bit, and the code is a bit thornier than I've had time to unravel and try to patch.

  • #15153
    Profile photo of Mike F Robbins
    Mike F Robbins
    Participant

    I have the same issue so I think it must be a bug with the forums. The workaround I use to make my code look correct is to edit my post immediately after posting it. You evidently have so long to edit a post after submitting it before it's locked and no changes can be made to it. Saving the post again after selecting edit without having to make any other changes makes my code look correct.

    The first post in this thread is an example of the issue I typically have where you end up with more than one block of code and a lot of extra spacing for the same set of code tags in a post.

  • #15155
    Profile photo of Joakim
    Joakim
    Participant

    Ok, thanks for the info.

    One idea that might be worth exploring... is to focus our efforst over at StackOverflow and the PowerShell category? The tools at Stackverflow are very easy to work with and there are a lot of people available to help handle the Q&A

    Or is this absolutely not something PowerShell.org wish?

    Cheers,
    Joakim

You must be logged in to reply to this topic.