System Bot 'moderator deleted post' changes wrong sections to code if code is present in the flagged message

Description: In this bug, when the system account sends you a message saying that your post was deleted by a moderator and your post contained code, the PM will format the code as text and the text as code, the message put at the end saying to visit the community rules also appears as code, breaking the link.

When it started happening: I first saw this bug about 5 days ago when system sent me the message.

Screenshots: (don’t worry the post was deleted as I asked a moderator to delete it, not because of any malicious reasons)


Reproduction Steps:

  1. Create a post with the following in it (the plain text and code can be changed as long as they stay plain text / code):

Code-.txt (42 Bytes)
2. Flag the post under ‘something else’ saying you want the post deleted.
3. Wait until you get the incorrectly formatted message from system.

I have tracked down the cause of this issue, and found out that in the message, system formats the message as code but if the moderated message contains code then the code becomes non-code and the plain-text becomes code. (Sorry if this is confusing)


Do you have a link to the flag message for me?


That’s the PM, please tell me if you can’t access it as I have previously had issues with admins trying to access my PMs.