How do they use a code by mistake? By clicking the code button in the editor? Or simply leaving 4 spaces at the beginning of the line?
You can try to hide the code button with CSS using:
.code.btn {
display: none;
}
You can also change the site setting code formatting style from the default 4-spaces-indent to code-fences. If users can leave 4 blanks spaces before a line (maybe because they use emails?) it is difficult for them to use ``` by mistake.
Those are great ideas - I’ve implemented both. Thank you!
I do think it is because they add four spaces to the start of a line. I wonder if this was a typing convention in some schools or something? Or it is entered via their email program? It seems to happen a couple of times a week.
I doubt they insert manually 4 space. I think instead that they write the posts via email. You should be able to determine this by looking at the post itself. If you see an envelope icon the post has been submitted by email.
You would be surprised! I had hundreds of users, in a instance where reply by email was disabled, putting the four spaces because they were mimicking pen and paper standards. They also did the same when using a word processor or email.
Dax, ho notato che anche con questa impostazione definita come ‘code-fences’, il sistema continua a tradurre quattro spazi in una formattazione del codice. Esiste un modo/opzione per disabilitare globalmente su un sito la convenzione “quattro spazi = codice markdown/formattazione”?
Lo chiedo perché un paio di volte a settimana un partecipante pubblica accidentalmente i propri commenti in formato codice, rendendoli difficili da leggere. Credo che ciò sia dovuto al fatto che questa convenzione è ancora diffusa tra alcune persone:
Considera questo come una richiesta di funzionalità.
Mi chiedo quale percentuale di forum Discourse abbia bisogno di blocchi di codice? A mio parere, potrebbe trattarsi di una minoranza distinta di comunità?