There are a few existing questions that discuss the use of the <pre>
tag in code blocks.
I hadn't noticed this much, if at all, before, but within the last fortnight or so there have been at least three questions where the poster included the <pre>
and </pre>
HTML tags in their code section. This causes the code to appear incorrectly, as anything that appears within <
and >
will not show, causing apparent bugs with C++ code like 'vector v' that looks like it won't compile when the posted code is really vector<int> v
. Experienced Stack Overflow users have commented on the apparent (but nonexisting) bugs in the posted code.
Can a check be added to the question sanitizer that will check for a <pre>
tag and tell the poster that it should not be used (or in some other way try to discourage its use)?
Update: Since I've posted this, I've seen several more instances of questions from new users having <pre>
and </pre>
right before and after (respectively) code indented four spaces. Where does this come from? Is something automatically adding those HTML tags?
<pre>
is I always have to stop myself from closing it with<post>
<pre>
formatting? I remove it when I find it.<pre>
instead of code formatting, I thought you were talking about people who use<pre>
inside a block with code formatting.