I've seen many posts
where code formatting
is used to highlight keywords
(example), which is not really allowed. A lot of these edits
are made by low reputation users and get approved
by high reputation users, either because they are robo-reviewers
or because they don't know it's not allowed
. I just flagged
a user who had made a lot of those edits for moderator attention
, but that's just one user and even if a moderator
gets that specific user
to stop, others
will still continue.
Many keywords that are usually wrongly formatted as code are names of programming languages, such as "C++", "Python", "Javascript", etc, or libraries, such as "Qt" or "OpenGL". My suggestion is to blacklist names of programming languages or libraries wrapped in backticks, so that a post or an edit can't be submitted if it contains for example `C++`
, `Python`
or `Qt`
. There could be a list of names of programming languages and libraries which can't be wrapped with backticks. If a user tries to do so anyway, they could get an error message like this one:
Maybe some programming languages and libraries whose names can also easily be code could be whitelisted, for example C since A
, B
and C
are sometimes used as example class names. Also, programming languages in code formatting should only be blocked if there is nothing else between the backticks, so "javascript
" should be blacklisted but not "<script type="text/javascript">
" (even though it contains the word "javascript" inside code formatting).
Also, I don't think it's necessary to ban wrapping names of programming languages or libraries inside <code>
tags (like <code>C++</code>
), since the users who wrap them in backticks would probably stop if they knew it weren't allowed (at least that's my guess) and most of them would probably try backticks first and see the error message and notice that it's not allowed. Also, in the rare cases where something that looks like a name of a programming language or library is actually code (for example if you need python
as a variable name or if there is a variable named C
that should be incremented by 1, the code for that in most programming languages I know would be C++
), it would be good to have a workaround, and that workaround could be using <code>
instead of backticks. But if it turns out that I'm wrong and users start abusing the <code>
tag too, it might be necessary to ban names of programming languages and libraries inside that too.
python
as a variable name.<code>python</code>
.<code>
tags. Actually, never used those. Also, I think it will be cause more trouble than the benefits of readability it gives.