23

I was going to fix a simple typo in this answer. In its first revision it goes like this:

If you want to get an array of ints, with values form 1 to 10, from a Stream, there is IntStream at your disposal.

So I wanted to change form 1 to 10 to from 1 to 10. Simple...

However when I edited the answer, I saw this:

enter image description here


As you can see, what should have read as Stream<Integer> is shown as just Stream due to <Integer> being interpreted as HTML (and rejected by the editor) I presume.

If I format things correctly I reveal what the author truly meant. However wouldn't that also invalidate the votes of the public? After such a change, this may or may not be the same answer that people found so useful.

What should I do?

7
  • Asking author to fix it generally preferred approach to any impactful changes to answers... Does the answer in current form make sense ? If yes there may be some ground to leave as is... but generally such fixes that show author's intent are ok and don't need discussion/get unconditional approval in review. Commented Sep 30, 2020 at 20:47
  • 16
    Personally I'd just add in the backticks. The post is not less correct using Stream<Integer> than just using Stream. The poster will notice. You can also just post a comment notifying the poster of the missing backticks.
    – Scratte
    Commented Sep 30, 2020 at 20:57
  • 2
    “Invalidating” votes is never a concern with edits. Users vote whatever revision they encounter.
    – yivi
    Commented Sep 30, 2020 at 20:58
  • Admittedly I'm not a Java expert so I don't know about that. But if in this context it is safe to do so, then I'll probably just do that. Thx @Scratte Commented Sep 30, 2020 at 21:01
  • 1
    The generic answer to your question is often "no" (in my opinion), but in this specific instance, fixing the formatting isn't invalidating (or even much changing) the meaning, since the edit changes so little.
    – zcoop98
    Commented Sep 30, 2020 at 21:06
  • But in general, you shouldn't change the formatting if it means changing the meaning.
    – 10 Rep
    Commented Sep 30, 2020 at 21:52
  • 1
    Since the answer was unanimously upvoted even in its incorrectly formatted version, I can't imagine you'd be invalidating anyone's votes by fixing it even if that were a concern. Commented Sep 30, 2020 at 23:14

2 Answers 2

56

Stack Overflow has always done this (C# type specifiers in < > being interpreted as HTML tags outside of a code block), and I've always fixed them without hesitation.

It's not about "don't make edits that change how the post is interpreted", it's "don't make edits that change the author's intent". The author intended for these to show, because they were made part of the question and are not HTML tags - they were just unaware that the text would go missing and didn't proofread their submission very well.

We see other kinds of problems like new users putting "example files" in without a code block, like "Hi, here is my file I'm trying to read, how can I split it into words":

line1 line2 line3

Of course, it looks like a single line file, and the FGITW might recommend string.Split on spaces. Had the post been formatted with code blocks:

line1
line2
line3

...it's a different interpretation. We make edits that change interpretations all the time, but we should always seek to preserve intent.

Experienced users will probably hit the Edit button to see the raw input before they post a "it's supposed to be Type<X> not Type kind of comment" or if they suspect that the line structure of the example file might be misrepresented, and if inexperienced users make a comment that is invalidated by a subsequent fix, they'll probably come to acquire the relevant experience that they should check before commenting.

If you do make a formatting fix that you feel invalidates anything, or if you feel that the OP would benefit from having it drawn to their attention so they don't make the same mistake again, it can be worth making a comment to that effect.

1
  • 1
    @ggorlen indeed, hence the paragraph of the answer that starts "Experienced users will probably hit edit..." - edit being used not as a "edit" initially, but a "see the raw user intent" which then could actually lead to an edit or an advisory comment to the user.. I too am always surprised how people don't seem to stop and think "wait, my post looks so much more garbage than all the questions I've copypasta'd my work out of up to now, how can I make it better?", but it seems a lot of the time they just don't know and seem unwilling to try. Could problems be autodetected/warned, I wonder..
    – Caius Jard
    Commented Oct 3, 2020 at 5:09
45

Escape the first <

Stream\<Integer>

Or use backticks

`Stream<Integer>`

You're not changing the meaning because

  1. It's already there, but seen incorrectly as HTML
  2. It's in the code block below
2
  • 5
    Either way, I don't see this as something you'd get in trouble for if you did fix it
    – Machavity Mod
    Commented Sep 30, 2020 at 21:08
  • 3
    A related problem that shows up in C code (probably elsewhere too) is when someone puts the first #include <header.h> line (it's usually one of those) on the same line as the triple-backquote for the code block. No error, but the #include line doesn't show up until the question is edited. Yes, it makes the question clearer; sometimes, it negates a comment about a missing header (but it was there in the question; it just wasn't displayed properly because the OP didn't realize the problem). I fix it — it makes the question a more accurate rendition of what the OP intended. Commented Oct 1, 2020 at 6:51

You must log in to answer this question.

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