5

I'm new to reviewing suggested edits, but one pattern I noticed is that many edits only change the style of code block formatting (mostly from indented to ```-based, example), in a way that does not result in any visible changes to the question/answer's HTML rendering.

Should such edits be rejected as trivial on principle? (And if so, why isn't that done automatically?) Or are there maybe some cases, devices, or renderers where it does make a difference?

4
  • 1
    Does this answer your question? Why do some code formatting-only edits get rejected? meta.stackexchange.com/a/313865/282094
    – Rob
    Commented Feb 1, 2022 at 16:07
  • 1
    @CloseVoters who selected "Relates to only one specific network site", please note that code blocks and code fences relate to multiple sites on the network (mainly programming-related ones) including here on Meta Stack Exchange, so not even only on programming-related sites.
    – 41686d6564
    Commented Feb 1, 2022 at 17:42
  • @Rob: Sorry, not quite. I tried to clarify.
    – Caesar
    Commented Feb 2, 2022 at 0:16
  • 1
    Due to the tags that change activates syntax highlighting (scroll to the bottom, read last sentence); so it does make a visible difference and isn't trivial - whether SO needs unprivileged users clogging an already busy queue with such a minor edit is a slightly different line in the sand.
    – Rob
    Commented Feb 2, 2022 at 0:49

2 Answers 2

7

If this is done as part of a good edit, that shouldn't stop you from approving it. However, if it's the only thing that is changed (like in the example you linked to) or the suggested edit is bad overall, then it should be rejected.

Should such edits be rejected as trivial on principle?

Yes, most definitely. It doesn't improve the post in any way.

And if so, why isn't that done automatically?

Simply, because there's no system that detects these kinds of edits; and I don't think there will ever be.

Or are there maybe some cases, devices, or renderers where it does make a difference?

No, they should render the same on all devices. One thing to note, however, is that if the suggested edit uses code-fence notation (i.e., ```) and fixes (incorrect) syntax highlighting (and nothing else needs to be improved in the post), then it should be accepted.

To quote from the We're switching to CommonMark post:

In a nutshell: If you want to declare the language for syntax highlighting in your code block, use the code-fence notation and not indented code blocks. You can still use indented code blocks, but declaring the preferred language explicitly for them is no longer supported moving forward.

(emphasis mine)

2
  • 1
    Worth noting, if the edit changes a post to use fences with the language identifier but the question already had the appropriate tag (and hence appropriate syntax highlighting was already applied) then the edit is still not an improvement. Commented Feb 2, 2022 at 1:42
  • 1
    @Nick Yes, that's what I meant but let me clarify it in the answer.
    – 41686d6564
    Commented Feb 2, 2022 at 11:16
1

Absolutely approve those edits if they add the right language code. Especially in cases where the source fences have different languages.

Even if the edit only adds the None language code it can be beneficial because it loads the page however slightly faster by avoiding the higlight.js language detection feature to run. You can even say those edits are environmentally friendly because they'll potentially spare a tiny amount of processor power with every view.

EDIT:

The post you linked has PowerShell as its main tag, that's a tricky case because PowerShell isn't supported. Of the few dozen PowerShell specific FR's spread across the network none have received an answer in the past (other users have gone ahead to use closest possible language codes here's one example however that's a wrong solution)...

Also see DavidPostill's excellent post his conclusion was using Default as the language code. However, the core dev of highlight.js has commented separately (I can't find the exact reference) that Default is an SE addition. So there isn't, at the moment, a right solution for PowerShell but as DavidPostill's answer demonstrates adding a source fence with Default can likely be the right interim solution (depending on tag) so improving the post to add a language can been the optimal review action. Saying that adding a source fence is wrong is also not the right answer because it depends on the remaining post and the tags...

3
  • 1
    I suspect that unless the question gets a lot of traffic, the humans making and reviewing the ```none edit use more energy than it will ever save. But good to know.
    – Caesar
    Commented Feb 1, 2022 at 15:51
  • @Caesar I'd say the additional DB space is marginal compared with deleted and spam posts/accounts that are kept around. Besides views should be considered the factor of greatest weight. Editing guidelines are to fix everything with a post and the source fence with language code is an important step in that direction.
    – bad_coder
    Commented Feb 1, 2022 at 16:04
  • (OT, but: I wasn't talking about use of electric power in computers, but about humans. ;))
    – Caesar
    Commented Feb 12, 2022 at 12:49

You must log in to answer this question.

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