Unformatted Code Detector

Most of new users in this forum do not notice that the markdown formatting will prevent their code to show properly. Other users willing to help them need to ask the new user to use the preformatted text marks. This brings a lot of noise, confusion and bad experience to the forum. See for example the confusion here:

I noticed that there is an official module for this problem. It tries to detect a code in a message about to be posted and shows a warning if it is not marked as preformatted text:

Can we have this installed here, please?

Unfortunately I have no idea how well it detects Python.

PS: Another useful function would be some reply templates but I will investigate this later.


That sounds like a useful add-on, indeed.

Nice! That would be hugely helpful. I haven’t done much user help lately, but at the time I did, virtually every reply started with ‘Please format you code using backticks, etc.’

The other plugin I wish would detect code posted as a screenshot …

for i in range(10):
print(‘this code is malformatted’)

Sorry folks, that was a test. See Disable automatic conversion of ASCII quotation marks to curly - #8 by jeanas

@admins As discussed again in Disable automatic conversion of ASCII quotation marks to curly - #8 by jeanas, this would be pretty useful. Could you enable it? Thanks!

It’s actually already installed (I just updated it as it was one commit behind).

OK, I did a test with a longer piece of code and it worked this time. Their heuristics might have changed in a way such that the example in their original demo is not functional anymore.