13

In the reply template for private moderator messages, the default salutation is:

Regards,
Stack Overflow Moderation Team

This salutation is supposed to appear on two lines, accomplished in Markdown by ending the first "Regards," line with two spaces.

Recently (within the past couple of days), there seems to have been a minor regression that is stripping the trailing spaces from the end of the "Regards," line in our template, causing the salutation to format on a single line:

Regards, Stack Overflow Moderation Team

If we catch this, it is easy enough to adjust it manually by adding the trailing spaces. But we tend to forget and overlook it, especially because we don't pay a lot of attention to the fixed salutation, so we end up sending messages that are incorrectly formatted and make us look dumb. Please do everything you can to help us not look dumb. :-)

On a related note, this regression has been in place for a very long time on the "contact a CM" message templates. The initial message looks fine, but replies omit the trailing pair of spaces after "Regards,", causing the salutation to appear on a single line. I don't know if these are connected in terms of a root cause, but it would be nice to have both corrected at the same time.


Update: We're still looking like idiots when we send these messages. Can this be fixed, please?

6
  • If the source of the template is a userscript, the issue may be caused by Tampermonkey. In Tampermonkey's settings, the "Editor" section (displayed when the config is "Beginner" or "Advanced") has a checkbox "Trim trailing whitespace from modified lines", which is checked by default. This can cause the trailing two spaces from the salutation to be stripped when editing the userscript, unless you disable the option, and/or write your strings with this issue in mind (e.g. use ` \n` in a template literal instead of two spaces followed by an actual new line).
    – Makyen Mod
    Commented Dec 19, 2020 at 3:30
  • It's not a userscript, @Makyen; Stack Exchange provides these templates as built-ins. And, yes, I would always use \n in code were I writing a userscript. I would expect others would, too.
    – Cody Gray Mod
    Commented Dec 19, 2020 at 4:01
  • Couldn't the two spaces be replaced with a space and a backslash? This would prevent tools that may remove trailing space on save, like Visual Studio Code, to interfere. Commented Apr 1, 2022 at 17:13
  • Even with my remarkably low tolerance for idiots, I fail to find this very upsetting. There may well be other circumstances where the formatting does make a difference, and so the bug should probably be fixed, per se.
    – tripleee
    Commented Apr 8, 2022 at 6:20
  • It is not the correct formatting for a salutation, @tripleee. Perhaps "idiots" is too strong of a word, but it definitely looks foolish, unprofessional, and inconsistent with the initial message, which is always (still) correctly-formatted.
    – Cody Gray Mod
    Commented Apr 10, 2022 at 19:28
  • @Cody pretty sure it's technically a valediction and not a salutation...
    – Jon Clements Mod
    Commented Apr 11, 2022 at 9:13

1 Answer 1

9

This has been fixed as of today.

The issue was being caused by the two spaces that trailed Regards, being formatted out of a string literal by Visual Studio's automated code formatting because they were being recognized as trailing whitespace.

I have implemented a new solution that should prevent this from happening in the future by inserting the trailing whitespaces at the location of a placeholder in the string literal so that they're not formatted out.

Thank you for bringing this to our attention and giving me the opportunity to close out my first ticket as a developer at Stack Overflow!

Regards,{toBeReplacedLater}
jrjones

3
  • 2
    Thank you, thank you, thank you!! I know it seems minor, but it's been very frustrating for years now, and I've really wanted to get this fixed. I appreciate you finally doing it. And I really appreciate that you've gone the extra mile to implement something that should prevent future regressions (as well as providing an explanation of the root cause and solution here). You're off to a great start as a new developer; welcome! I'm happy to provide additional items to help you fill your quota if needed. :-)
    – Cody Gray Mod
    Commented Aug 30, 2022 at 23:34
  • That seems like a somewhat nasty bug in the code formatter; surely a formatter should not be making changes that change the meaning of a program! Thanks for the fix and the explanation; I'll now be saved a few keystrokes every time I reply to a mod message :-)
    – Ryan M Mod
    Commented Aug 31, 2022 at 0:06
  • So...true to your word, your solution has prevented it from happening in the replies...however, it's now happening in the original messages. Any chance you could apply that same fix to the original ones as well?
    – Ryan M Mod
    Commented Sep 20, 2022 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .