Do you think it is that hard to automatically detect _possible_ pieces of code in a post and to inform the poster that he may want to revise the contents as an additional step before the data is actually placed online? This may have been proposed before but it seems to me like a good idea, given the number of people who don't care and don't read instructions, among others...
Yes, I have several times suggested that they should scan for some of the 8051 and ARM assembler instructions, and some typical C constructs. The use of braces and nested parentheses is a good indication that someone is posting source code.
why?
Just put
void CCode();
around it and it works fine :-)
What actually _would_ be nice is, if there is a Button that auto inserts <'pre'>.
But I think you'll need Rich Controls for that...
BR, /th.
If you accidentally tags the following paragraph as code, then you will get text that is wider than the monitor since preformatted text honors explicit line breaks.
This is an example of a text paragraph that if accidentally auto-converted to code would make the thread unreadable since it contains inlined source like: if ((FIO0PIN & (P0_MAIN_POWER | P0_AUX_POWER)) != 0) { set_supply_mode_external(); }
But the problem is not the difficulty of doing it correctly; the problem is with people who don't even think about doing it at all - so having a button wouldn't help, because they still wouldn't press it!
:-(
Hence the original request to auto-detect what looks like source code and prompt the unobservant user, "don't you think you should have formatted this as source code - like this...?"